moving everything except a directory

Loren M. Lang lorenl at alzatex.com
Fri Sep 9 06:07:11 PDT 2005


On Fri, Sep 30, 2005 at 05:40:00PM -0500, Brian John wrote:
> Say I am at ~ and I have 10 directories inside named 1, 2, 3, 4 ,5, 6, 
> 7, 8, 9 and 10.  What command can I use to move everything but directory 
> 2?  What if I wanted to move everything but directories 2 and 7?
> 

find ~ -mindepth 1 -maxdepth 1 ! -name 2 -exec mv {} /path/to/new/place

find ~ -mindepth 1 -maxdepth 1 ! -name 2 ! -name 7 -exec mv {} /path/to/new/place

> I'm not sure how to use the mv command to do this in 1 comand.

> 
> Thanks
> 
> /Brian
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 

-- 
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20050909/ab55d16b/attachment.bin


More information about the freebsd-questions mailing list