SSH cp command

The cp command stands for copy and is used to copy content like files in a Linux system. We’ll show some basic usage of the SSH cp command in the article below:

Simple copy with SSH cp command

cp myFile.ext /path/to/newFile.ext

WildCard cp usage

This will copy all files in the current directory that end with .ext

cp *.ext /path/to/store/newFiles/

Copy directory with SSH cp command

This will copy all the content of the folder directory and it’s structure with files to the newDirectory

cp -R /path/to/directory /path/to/newDirectory

Copy with keeping the parent directory structure

This will create a file in the following dirStructure /path/to/newDir/currentDir/path/to/

cp --parents ./currentDir/path/to/copyFile /path/to/newDir
  • 0 Kasutajad peavad seda kasulikuks
Kas see vastus oli kasulik?

Seotud artiklid

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