![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use wildcards in a script | emferrari | Shell Programming and Scripting | 13 | 03-07-2008 04:14 AM |
| Wildcards in SED | HealthyGuy | Shell Programming and Scripting | 5 | 09-27-2006 08:32 PM |
| ls with wildcards | benu302000 | UNIX for Dummies Questions & Answers | 10 | 06-29-2005 02:53 PM |
| wildcards | benu302000 | UNIX for Dummies Questions & Answers | 3 | 06-29-2005 01:10 PM |
| Wildcards in VI | peter.herlihy | UNIX for Dummies Questions & Answers | 8 | 01-08-2002 04:27 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
wildcards NOT
Hi All
Please excuse another straightforward question. When creating a tar archive from a directory I am attempting to use wildcards to eliminate certain filetypes (otherwise the archive gets too large). So I am looking for something along these lines. tar -cf archive.tar * <minus all *.rst files> Can anyone help. Thanks Ed |
|
||||
|
I found the answer to my question here.
ITworld.com - UNIX SYSTEM ADMINISTRATION - Trimming Tar Files Apologies I should have read the man page a little more closely before posting. Ed |
|
||||
|
Hello grial
I am running the HP-UX tar so unfortunately your first suggestion using -- exclude is not available to me and indeed my optimistic post above including the web link is not relevant in my case. Your second option is more promising however I am attempting this opertion in the C shell and the command substitution $(find . ! -name '*rst') seems to be throwing a shell error. Is command substitution of this form possible in the csh and if not what are the options assuming I do not want to just fire up another shell. Thanks Ed |
|
||||
|
Hi grial
Finally got this to work tar cvf archive.tar `find . \! -name '*rst' -type f` Back ticks seem to achieve the command substitution I am looking for in the c-shell and I had to modify your find command by adding the type f to prevent it from returning the directories including . This isn't ideal as I can see a scenario where I may want to find non-rst files in sub directories also. Ed |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|