Copy / Paste files and folders.
– copy a file
~# cp filename1 filename2
A copy from filename1 is created in the same directory
~# cp /home/myweb/filename1 /home/hisweb/filename2
Creates a copy from filename1 into another directory and name filename2
To copy a folder use the -r ( recursive option )
~# cp -r folder1 folder2
~# cp -r /home/myweb/folder1 /home/hisweb/folder2
To copy and preserve the user and group rights use the -p flag
~# cp -rp filename 1 filename2
To show all options type:
~# cp –help
To move a file or to rename a file use:
~# mv filename1 filename2
For folders addd the -r ( recursive ) flag
~# mv -r folder1 folder2