Operating System - HP-UX
1752580 Members
3195 Online
108788 Solutions
New Discussion

What happens when you use 'scp' without remote_dir?

 
Gen-i_ICT_Ops
Occasional Contributor

What happens when you use 'scp' without remote_dir?

Greetings,

 

Does anyone know what happens if you use 'scp' command and NOT specify the remote_dir and though you do specify remote server i.e example below:

 

root@local # scp  local_file  remote

 

What I've discovered that unless to full remote_host:remote_dir is specified, it simply performs a local copy (in the same dir) and creates a file with the name 'remote' exactly as the command below:

 

root@local # cp local_file remote

 

So for those who are wondering why it was such a fast copy and where did it went, there's the answer.

 

Hope that helps,

 

 

P.S. This thread has been moved from HP-UX > System Administration to HP-UX > networking. - Hp Forum Moderator

2 REPLIES 2
Patrick Wallek
Honored Contributor

Re: What happens when you use 'scp' without remote_dir?

The key there is that there is no ':' character after the "server" name in your example.

 

If you happened to do the following:

 

# scp afile server:

 

The you will get a file named "afile" on the remote server in the home directory of the user doing the copy.

Gen-i_ICT_Ops
Occasional Contributor

Re: What happens when you use 'scp' without remote_dir?

That's quite right however my point was 'if' without any 'colins and server path after the hostname' the above happens.