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 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

How to Install WordPress via SSH

Since WordPress is the most widely used CMS it’s installation process has been made as simple and...

SSH Execute Command on a Remote server

Via SSH you can connect to a remote server’s shell. This will allow you to execute commands on...

How to connect to your shared hosting account via SFTP with FileZilla

SFTP is a convenient way to use SSH, while also using the interface of a simple FTP. In order to...

SSH netstat command

If you wish to debug or track statistics of your network in a Linux environment you can use SSH...