Tar all files and exclude a folder?

How to tar all files and folders in current folder except one folder?

sunroof

How to tar all files, folders, subfolders... in current folder except one folder named 'test'?

something like: tar -cf all.tar * + exclude 'test'

Thanks

lammert

12:06 am on Mar 12, 2008 (gmt 0)

You first need to allow extended wildcard options, you can then exclude files or directories from the tar command line. I use the following commands to backup everything in /usr/src, except for the sub directories that start with "linux-2.6". You need to experiment a little to see how you have to construct the excluding wildcard options for your situation.