linux copy directory and contents to another directory code example

Example 1: copy all files from a folder to another ubuntu

cp -a ./source/. ./dest/

Example 2: copy contents of directory to another directory linux

cp -a /source/. /dest/

Example 3: linux copy folder with files

cp -R path_to_source path_to_destination/

Example 4: terminal copy directory

$ cp -R <source_folder>/* <destination_folder>

Example 5: linux make a copy of a folder in another foldedr

$ scp -r <source_folder> <destination_user>@<destination_host>:<path>

Example 6: how to copy directory to another directory in linux

cp -r <DIRECTORYPATH> <WHEREYOUWANTTOCOPYTO>
#for example
cp -r /home/thor/asia/india/bangalore /home/thor/

Tags:

Misc Example