To copy a whole directory structure you can use -r option of cp
It copies all the files in a directory and its subdirectories.
#-- Copy every thing from /homeDir/yourDir to /homeDir/tempDir/
cp -r /homeDir/yourDir/* /homeDir/tempDir/
Note:
You can use other supported wild cards ( instead of * ) to be more "selective" while copying.
#-- Copy every file/directory, which starts from 'S', from /homeDir/yourDir to
#-- /homeDir/tempDir/
cp -r /homeDir/yourDir/[S]* /homeDir/tempDir/
Tuesday, July 1
How to copy whole directory tree
Labels:
UNIX ksh tips
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment