Friday, December 31, 2010

How to copy all including hidden files or directories using linux shell

While copying all stuff under a directory into another place, by

cp  $SRC/*  $DST

will fail to copy all the hidden file (prefixing with ., the dot) in the end.

A foolproof way to achieve this is to go sinuously :

cp $SRC/*  $SRC/.* $DST

there will come up with prompt like :
cp: omitting directory `$SRC/.'
cp: omitting directory `$SRC/..'

just turn back on it. having got thing done.

No comments:

Post a Comment