command to copy hidden files?

James Wilkinson fedora at aprilcottage.co.uk
Tue Jan 23 17:35:44 UTC 2007


Dave Stevens wrote:
> I've tried to copy files from my home folder to do a disk upgrade. I
> foolishly only copied the visible (non-dot) files. Now I'd like to copy
> only the . files (recursively) but don't see what the syntax is. Anyone?

Back in 2004, Ulrich Drepper (the maintainer of glibc) wrote on this
list:
> The most straight-forward way is to tell the shell you want the dot
> files:
>
> $ ls -a
> ./  ../  .uu
> $ echo *
> *
> $ shopt -s dotglob
> $ echo *
> .uu
> $ shopt -u dotglob
> $ echo *
> *

In other words, use shopt -s dotglob and leading dots stop being
special.

Hope this helps,

James.

-- 
E-mail:     james@ | WARNING:  Pressing CTRL+ALT+DEL again will restart your
aprilcottage.co.uk | computer.  Then again, what won't?  You will lose unsaved
                   | information, and even supposedly saved information, in
                   | any case.                              -- David P. Murphy




More information about the fedora-list mailing list