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

Re: A simple question about wildcards with tar

-----Original Message-----
From:    Walter Landry landry@physics.utah.edu
Sent:    Wed, 03 Oct 2001 13:57:58 -0700
To:      debian-user@lists.debian.org
Subject: A simple question about wildcards with tar


I'm trying to make a backup with tar, but there are certain 
files that
I don't want to include in the backup.  Reading the info 
about tar, it says that I can use the --exclude=PATTERN 
option.  So if
I type

  tar -cvf backup.tar --exclude='*.fig' *

then it excludes all files that end with .fig.  However, if 
I also
want to exclude files that end with .fig.bak, then it
seems that

  tar -cvf backup.tar --exclude='*.fig*' *

should work.  But it doesn't.  Typing 

  tar -cvf backup.tar --exclude='*.fig*' --
exclude='*.fig????' *

does work.  But it won't work for me in the general case, 
where I
won't know how many characters follow the pattern that I'm 
Does anyone know how to do this?

Walter Landry

To UNSUBSCRIBE, email to debian-user-
with a subject of "unsubscribe". Trouble? Contact 

How about:

tar -cvf backup.tar --exclude='*.fig*' --exclude='*.fig?*' *

If ???? matches exactly four characters, then ?* should 
match any string of at least one, am I right?


Visit http://www.visto.com.
Find out  how companies are linking mobile users to the 
enterprise with Visto.

Reply to: