Home » Categories » Linux Command Line

Unix zip directory but excluded specific subdirectories (and everything within them)

zip -r myarchive.zip dir1 -x dir1/ignoreDir1/**\* dir1/ignoreDir2/**\*

 

Reference:

https://superuser.com/questions/312301/unix-zip-directory-but-excluded-specific-subdirectories-and-everything-within-t

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Comments Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
Tell yum to ignore a single dependency - nodeps
Viewed 1744 times since Thu, Feb 2, 2023
How to Get the Size of a Directory in Linux
Viewed 576 times since Tue, Sep 1, 2020
How do I find all files containing specific text on Linux?
Viewed 575 times since Mon, Jan 17, 2022
’Argument list too long’ error while copying a large number of files
Viewed 548 times since Tue, Sep 1, 2020
How to remove all files starting with a certain string in Linux
Viewed 1345 times since Wed, Feb 1, 2023
How to Exclude Specific Packages from Yum Update #2
Viewed 1466 times since Wed, Nov 8, 2023
Add cron jobs directly to Scheduled Cron Jobs
Viewed 638 times since Tue, Jul 19, 2022
How To Extract .tar.gz Files using Linux Command Line
Viewed 478 times since Sun, Sep 6, 2020