Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I copy to another directory?

share|improve this question

migrated from Oct 25 '09 at 23:48

This question came from our site for professional and enthusiast programmers.

If you are connected to a shell session via ssh, and the file exists on the remote system, you can use the cp command.

cp sourcefile destfile

If the file exists on the local system you should use sftp. If your local machine runs Windows, WinSCP is an excellent sftp client.

share|improve this answer
why would you use sftp when you have scp, which goes over SSH so it doesn't require any extra software or ports? – rmeador Oct 21 '09 at 19:46
The original poster didn't say they had scp. Assuming they don't have it, WinSCP is much easier. Furthemore, sftp uses the same port as ssh. – G-Wiz Oct 21 '09 at 20:15

Assuming you're using the command line then like this

scp myfile.txt dest/

for a local file or alternatively

scp user@myserver:/path/to/myfile.txt user@myserver:/path/to/dest/

share|improve this answer

If you are using Win32, Tunnellier is a reasonable solution which not only allows file transfer, but secure remote access as well.

share|improve this answer

You must log in to answer this question.