fr33z
asked on
Linux copy folders and subfolders
How do i copy a directory that contains files, folders, and subfolders?cp /1directory/the-files-i-wa nt to-copy-that-contains-file s-subfolde rs-i-need/ * /destination/
thanks fr33z
thanks fr33z
cp -r /1directory/the-files-i-wa nt to-copy-that-contains-file s-subfolde rs-i-need/ * /destination/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
"cp -r" will do the thing you want.
However, there are some special type of files in Unix/Linux filesystem you need to
use other way.
Most of type, I'll do the following command to include those special type of files:
tar cf - /1directory/the-files-i-wa nt to-copy-that-contains-file s-subfolde rs-i-need | (cd /destination ; tar xf - )
Wesly
"cp -r" will do the thing you want.
However, there are some special type of files in Unix/Linux filesystem you need to
use other way.
Most of type, I'll do the following command to include those special type of files:
tar cf - /1directory/the-files-i-wa
Wesly
Well, here's really no need for extra tar/untar steps to copy subdirs that may have special files.
cp -dpR A B
is for
or (GNU-Coreutils specific)
cp -av A B
Will copy the special files around.
cp -dpR A B
is for
or (GNU-Coreutils specific)
cp -av A B
Will copy the special files around.