Command to tar directory excluding certain files folders

0 votes
Is there any shell command/script that supports excluding certain files/folders from being archived?
Jul 13, 2019 in Linux Administration by Upasana
• 8,620 points
1,294 views

1 answer to this question.

0 votes
$ tar --exclude='./folder' --exclude='./upload/folder2' -zcvf /backup/filename.tgz .

Try this!
answered Jul 13, 2019 by Shubham
• 13,490 points

Related Questions In Linux Administration

–1 vote
1 answer

How to use help command for ls?

The help command is limited and it ...READ MORE

answered Jan 3, 2019 in Linux Administration by Omkar
• 69,220 points
3,482 views
–1 vote
1 answer

How to use help command

The help command is limited and it ...READ MORE

answered Jan 11, 2019 in Linux Administration by Omkar
• 69,220 points
649 views
0 votes
1 answer

How to change permissions of folder and files in folder?

The chmod command is used to set/change the permissions ...READ MORE

answered Feb 1, 2019 in Linux Administration by Omkar
• 69,220 points
2,012 views
0 votes
1 answer

How can I find out which files differ in two directory trees?

Use this; diff -qr dir1/ dir2/ READ MORE

answered Jun 13, 2019 in Linux Administration by Upasana
• 8,620 points
810 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Adding yes/no/cancel prompts in shell script

You can use the read command. Here's ...READ MORE

answered Mar 13, 2019 in Linux Administration by ajs3033
• 7,300 points
4,255 views
0 votes
1 answer

How to change the default shell in Linux?

1. Change the password file directly for ...READ MORE

answered May 24, 2019 in Linux Administration by Upasana
• 8,620 points
1,021 views
0 votes
1 answer
0 votes
1 answer

Removing a symlink to a directory

rm foo try this. Also, You need write ...READ MORE

answered May 15, 2019 in Linux Administration by Shubham
• 13,490 points
655 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP