Tuesday, July 1

How to copy whole directory tree

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/

0 comments:





Disclaimer :
Unless, otherwise mentioned, TF's SQL tips/tricks are for Sybase ASE 12.5.x