Copy all except one file?

Mike Bird mgb-ubuntu at yosemite.net
Sat Jul 29 16:17:28 UTC 2006


On Saturday 29 July 2006 04:50, Soo Qing wrote:
> I often need to copy all files (*) except one file
> (example.txt) from one directory to some places. How
> do I do that from the terminal?

rsync can be used for local copies, and supports --exclude:

$ mkdir foo
$ cd foo
$ touch a b c d
$ rsync -va --exclude=c * /tmp/
building file list ... done
a
b
d

sent 174 bytes  received 80 bytes  508.00 bytes/sec
total size is 0  speedup is 0.00


--Mike Bird




More information about the ubuntu-users mailing list