[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-tar] Re: Why I can not exclude .*.*.swp files?
From: |
Nathan Stratton Treadway |
Subject: |
[Bug-tar] Re: Why I can not exclude .*.*.swp files? |
Date: |
Sun, 4 Apr 2010 23:00:13 -0400 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Sun, Apr 04, 2010 at 20:31:45 -0500, Peng Yu wrote:
> Maybe this is an easy question. But I can not exclude .*.*.swp file in
> the resulted tar.gz file. Could you please let me know how to do it
> correctly?
>
> $ tar czvf ../trial/`basename $PWD`.tar.gz ../`basename $PWD`
> --exclude={.*.*.swp}
> tar: Removing leading `../' from member names
> ../current_diretory/
> ../current_diretory/.main.sh.swp
> ../current_diretory/main.sh
Off hand, I'd guess it's because you have "{" and "}" characters in your
exclude pattern; probably you want to say
--exclude='.*.*.swp'
instead (though I'm wondering if you wouldn't want to just exclude all
'.*.swp' files, in case there's a .README.swp file or whatever).
You can find some examples of using the --exclude= option at:
http://www.gnu.org/software/tar/manual/html_section/exclude.html#SEC108
Nathan
----------------------------------------------------------------------------
Nathan Stratton Treadway - address@hidden - Mid-Atlantic region
Ray Ontko & Co. - Software consulting services - http://www.ontko.com/
GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt ID: 1023D/ECFB6239
Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239