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

Re: OT (ish): How to copy hidden files/directories



On Sat, 9 Oct 2004, Chuck_Sterling wrote:

CB wrote:

I can't figure out how to do this: copy (or move) all the hidden files
and directories contained in one directory to another directory.

Is it as embarrasingly simple as I imagine it must be?

Go to the source directory, then


find . -print | cpio -pmud <dest>

If you want it verbose, use

find . -print | cpio -pmudv <dest>

These preserve permissions and such during the copy...

when i teach my intro linux course, this is one of the exercises i assign:


1) using only the regular shell wildcards, come up with a way to match *everything* in the current directory (files, dirs, hidden, non-hidden), with the exception of the two entries "." and "..".

and the answer is ... ?

rday

p.s. this is command independent, nothing to do with "find". it's strictly a pattern-matching exercise using wildcards.


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