|
|||||||||
| UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers |
learn unix and linux commands |
| Tags |
| regex, regular expressions |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
tar'ing and regular expressions
Hi,
How do I tar all but a specific set of files in a directory? Is it possible to use regular expressions in the tar command? I want to tar all files except those beginning with D. I tried this tar -cvf files.tar ^[^D] but this didn't work. Anyone any ideas. Thanks |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
tar cvf files.tar [!D]* In some cases you have to escape the bang ([\!D]). |
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
Thanks Radoulov. That's cracked it.
|
| Sponsored Links | ||
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Regular expressions help | linuxkid | Shell Programming and Scripting | 6 | 07-30-2010 04:49 AM |
| sed and regular expressions | AlbertGM | Shell Programming and Scripting | 6 | 10-13-2009 09:32 AM |
| SED regular expressions | noppeli | Shell Programming and Scripting | 3 | 09-10-2009 08:53 AM |
| Need help with Regular Expressions | jidsh | Shell Programming and Scripting | 5 | 04-20-2009 05:00 PM |
| Regular Expressions | ramky79 | UNIX for Advanced & Expert Users | 3 | 05-21-2008 06:13 PM |
|
|