LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2010, 10:39 PM   #1
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Rep: Reputation: 30
how to tar file with exclude a directory


[ --exclude FILE ] [ -X, --exclude-from FILE


I tar to tar some directory and exclude a directory , I tried tar -cvf /tmp/test.gz ./* --exclude ./temp but not work , and the parameter --exclude seems exclude file only not directory , can advise what can i do ? thx
 
Old 03-02-2010, 11:15 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Notice that the man page specifies that the argument to --exclude is a "PATTERN" not at path.

So what happens if you use '--exclude temp' instead of '--exclude ./temp'?

Evo2.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to restore a tar file and exclude a directory j-me Linux - General 3 01-26-2010 01:24 PM
How to exclude a Directory with TAR fw12 Linux - Software 3 03-28-2008 05:43 AM
tar --exclude=directory ampop Linux - Software 7 06-20-2006 02:12 AM
Exclude file types in smbclient tar UltramaticOrange Linux - Networking 1 04-09-2006 05:11 PM
tar --exclude-from=FILE GATTACA Programming 1 07-29-2005 01:25 PM


All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration