Copying and moving files
Copy file1 and name it file2
cp /home/des/file1 file2
Copy recursively all files beginning with a . to the profiles.backup folder
cp -r .?* profiles.backup
Move file1 to file2 , if file 2 does not exist file1 is just renamed to file2, if file2 does exist then file1 is moved to file2
mv /home/des/file1 file2
To move 3 files to a directory
mv file1 file2 file3 directory
To mv only when the source file is newer than the destination file or when the destination file is missing.
mv -u /home/des/* /home/des_backup
Copy all files and folders including hidden files from one directory to another
Say i have a folder /home/temp and want to copy everything in it to a new folder called new
cd /home
mkdir /home/new
cp -r /home/temp/. /home/new
This will copy all files/folder recursively from /home/temp in to the already existing folder /home/new
If you want to keep all file structure/permissions/symlinks intact you can use tar
tar c source | (cd target && tar x )