To copy an entire folder (directory tree) in Linux, use the following method:
mkdir target_directory
cd source_directory
cp -ap . target_directory
Other options:
cp -apv . target_directory
(for verbose results)
\cp -ap . target_directory
(for unix)
More info:
– linuxguide.sourceforge.net
How to go about moving the file.. mv does not work
with mv -apv ….
better explanation would be:
mkdir target_dir
cd source_dir
cp -ap . /path/to/target_dir
mkdir : makes directory
cd : goes to a directory
cp : command for copy
-ap : cp options for copying files/folders with the same attributes/permissions…
. : stands for all files/folders
sudo cp destination-dir target-dir -r
Hello guys
cp -a source-dir target-dir