Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excluding files while creating a tar using -X

Status
Not open for further replies.

cptk

Technical User
Mar 18, 2003
305
US
What's the syntax? I can't seem to get the correct combination.

>tar -cvf new.tar -X xlist

where xlist is a file containing a list of files or directories I want to exclude from the new.tar file.
 
never mind, I found what I needed. I thought maybe you didn't need to create an actual file containing the files or directories you wanted to exclude. BTW -- also include the name of the exclude file in the actual exclude file to exclude if desired.

> tar Xcvf exlist test.tar *
or
> tar cvfX test.tar exlist *

The placement of the actual list of files to include (i.e. "*") was what was tripping me up.

where "exlist" is a list of file or directories to exclude
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top