Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i wonder, do you know man? In case you don't: type
man man
to get an explanation.
In case you know man, do you know that you can search in man pages by typing / and the word you search for?
try for example:
man tar
and in the program type
/exclude
and tada you have what you where looking for.
offence meant!
short:
tar cf <whatever.tar> --exclude=<file you do not want to include>
Originally posted by 0x0001 i wonder, do you know man? In case you don't: type
man man
to get an explanation.
In case you know man, do you know that you can search in man pages by typing / and the word you search for?
try for example:
man tar
and in the program type
/exclude
and tada you have what you where looking for.
offence meant!
short:
tar cf <whatever.tar> --exclude=<file you do not want to include>
As this is very helpful reply, lighten up with the attitude. Its one thing to tell someone to go RTFM, but you don't have to say it the way you did with anything extra. If you can't be polite in your posts, then don't post at all and the next member along would have answered his question most likely in a polite and professional manner.
Anyway, I don't make a habit of asking a question here unless I have first looked in man and found the information sparse or unhelpful. To wit: the description of --exclude simply states that FILE will be excluded. It doesn't give any additional information, such as how I can specify multiple files in the --exclude argument or if I can specify directories. I assumed that I could specify directories and that I would write a tar command, excluding 3 directories (My Documents, Program Files, and the windows directory) from my Windows partition along these lines:
tar -czvf todaysarchive.tar.gz /mnt/win_c --exclude My\ Documents Program\ Files windows
But, that didn't work: one of the first things tar did was to write mnt/win_c/windows/* to the archive. (At which point, I killed the job.)
no error msgs, every command i used ( well all are listed above) they just tar everything .. i had to kill the process everytime
i want to exclude a folder .. not a file
thanks
i have a site on a server .. and now am in the root folder of that site.. fine?
there are many subfolders in the root folder ... one of them is the httpdocs folder that contains the site's files
i have temp folder that i do some testing in it ..and it contains huge files that i don't want to include when i do a full back up for the httpdocs folder ..
the command i used was:
tar -cvf backup.tar httpdocs/ --exclude httpdocs/temp/
this would tar everything .. it tars what the temp folder contains
i tried the commands listed in this thried but they all tared everthing
The --exclude requires and = after it. It reports no error if it is missing, it just doesn't work. Kinda stupid but we got to live with it.
try:
tar -cvf backup.tar httpdocs/ --exclude=httpdocs/temp/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.