Re: HOW2 copy file-tree?



On Mon, 14 Dec 2015 19:26:52 +0200
chris glur <crglur gmail com> wrote:

... so, of course I usd mc to copy the file-tree,
then I noticed that mc showed:--
|/.dbus           |   4096|Dec  9 17:25|
|/.gnuzilla       |   4096|Dec  9 17:25|
|/.kde            |   4096|Dec  9 17:26|
|/.links          |   4096|Dec 10 15:29|
|/.mc             |   4096|Dec 12 12:04|
|/.mozilla        |   4096|Dec  9 17:25|
|/.pan2           |   4096|Dec 14 18:52|
|/.wilybak        |   4096|Dec 11 19:08|
|/.xine           |   4096|Dec  9 17:25|
| .Xauthority     |    103|Dec  9 16:39|
| .bash_history   |     43|Dec 11 11:07|
| .blackboxrc     |   1425|Dec 11 17:52|
| .servera~h.13990|     54|Dec  9 16:39|
| .xinitrc        |    530|Dec  9 16:39|
| KogiRootDir     |    931|Dec 12 12:04|

   and then I remembered that instead of copying the whole tree, there was only
a file: KogiRootDir     |    931.

It seems that the problem is related to:
  `ls /*` does NOT show <dotted Files> by default;
whereas mc  is much better.

Still I want to know how to do this simple task as a command-line.

Hi Chris,

to show really *a*ll files, you can use ls -a.

To copy all files you can use:
cp -r src/* src/.[^.]* src/..?* dst/
which means all files not beginning with a dot and all files beginning with a dot but not a .. file (which is 
a parent directory) and all files starting with ..
By the way, you'd want to use -a argument to preserve file attributes (mode, ownership, timestamps, links,..).

Regards,
Andrey


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]