Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7575279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:38:53+00:00 2026-05-30T16:38:53+00:00

I want to compress a directory in Linux. I created a tar.gz that it

  • 0

I want to compress a directory in Linux. I created a tar.gz that it turns to be a big file, due to the reason that the directory contains some *.o files and some pdf files.

Is there any way to compress a directory but exclude files larger than a predefined SIZE? There is a –exclude argument in tar command, however I would like to reject files larger than 1 MB. This is the constrain, not the name of the file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:38:55+00:00Added an answer on May 30, 2026 at 4:38 pm

    find ./myRep/ -type f -size -1024k | xargs tar cfvz myArchive.tar

    In a word, first part of this expression construct a list of files that size is lower than 1024k recursively from ./myRep/ and second part create tar/gzip archive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a directory that contains several files. I want compress this folder to
So there are some folders that I would like to compress into tar.gz file
I have a text file that I want to compress after it gets an
I want to compress big text files with python (I am talking about >20Gb
I have to compress multiple files to one tar-File. As I have to repeat
I want to write a Python program that makes PNG files. My big problem
I want to compress the files in ruby. for example I have file: base_1.txt
I want to compress some files (into the ZIP format) and encrypt them if
My situation is the following: a big (10GB) compressed file containing some files (~60)
I want to run a cron and compress my /var/log directory every hour to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.