How to move and copy files using SSH?

Lets look at some of the other functions you can execute via SSH. If you want, for example, to move and copy a file to a different folder you need to type the following: 

mv index.html /path/to/directory/index.html ( this command will move it)

cp index.html /path/to/directory/index.html  (this command will copy it)

Copying a whole folder is done using the -r option of the cp command. This will copy the whole folder recursively for example:

cp -r /path/to/folder /destination/path

The mv command can also be used to rename a file. For example:

mv index.html newindex.html

Note that unlike windows, Linux files are key sensitive, so if you are going to move or edit a file you must type the exact name.

  • 0 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

SSH ip command

If you wish to obtain information about your server’s IP on a Linux machine using SSH you can use...

SSH rm command

If you wish to remove a file or folder from your Linux system you can use SSH rm command. In this...

SSH echo command

One of the most useful commands in a Linux environment is echo. With it, you can provide output...

SSH history command

If you wish to find what commands you have previously executed in a Linux environment you can use...

SSH cd command

SSH cd command is mainly used to navigate in your Linux environment. In this article, we’ll show...

Powered by WHMCompleteSolution