Find and delete files greater than a given size from the Linux command line
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY Anoop John
7 years ago
Linux-Tips
0 comments comment

The find command available in GNU/Linux shells is a versatile tool for finding files matching the given conditions in a folder and performing a specific action on the files found. The following command will find all files greater than 1M size in your current folder and ask you if you would like to delete the file

find . -size +1M -exec rm -i {} \;

The following command will find all tar.gz files greater than 1M size and ask you whether you wish to delete them.

find . -size +1M -name "*.tar.gz" -exec rm -i {} \;

The following command will find all tar.gz files greater than 1M size and less than 20M size and ask you whether you wish to delete them.

find . -size +1M -name -size -20M "*.tar.gz" -exec rm -i {} \;

Find is an extremely powerful tool. To know more check out man find and read through the full set of offerings.


RELATED ARTICLE

/themes/custom/zyxpro_light/images/placeholder.png
close

on 27th July 2008 / by webmaster
We run apt-cacher to save bandwidth in our intranet. All Ubuntu systems in our office uses the apt-cacher server to update and upgrade. Recently we started getting the hash sum mismatch and size mismatch errors. After some dabbling with the settings and the files we figured out a simple solution for this problem. Linux System Administration Ubuntu Linux Tips Leave a reply Your email address will not be published. Required fields are marked * Atomymous (not verified) access_time 23 Sep 2019 - 10:34 I found this article because I was experiencing the same problem. My case turned out to be because, here at work, I'm behind the corporate firewall and needed to configure apt-get to use the proxy server (in Synaptic Package Manager -> Settings -> Network tab) george (not verified) access_time 23 Sep 2019 - 10:34 In reply to Same misleading error for proxy problem by Atomymous (not verified) i am running ubuntu 8 at home, desktop. i keep getting fetch fail, hash sum mismatch from updates. do you think the above fix will work and if so could you generate a step by step walkthrough as i am new to linux and command line use. george Nigel Horne (not verified) access_time 23 Sep 2019 - 10:34 You also need to check if you're running Dans Guardian. That software stops you updating your system. sadeed86 (not verified) access_time 23 Sep 2019 - 10:34 try updating any package using the same source..for example, if u r using lock info which is downloaded from insanelyi, adding more plug in such as weather plug in must be from the same source from insanelyi as well...the same apps from different source has different packages, thats why updating or plugging in show some error... claive alvin p… (not verified) access_time 23 Sep 2019 - 10:34 su to root, then #rm -f /var/cache/apt/partial/* #rm -f /var/cache/apt/*.deb *Do not remove the partial folder under /var/cache/apt I saw this at http://paulpodolny.blogspot.com/2011/06/ubuntu-hash-sum-mismatch-workar… Pagination Current page 1 Page 2 Next page Next › Last page Last » Add new comment
/themes/custom/zyxpro_light/images/placeholder.png
more_horiz
close

on 03rd June 2009 / by webmaster
If you are a regular GNU Linux user there is a very good chance that you will come across emails forwarded to you as .eml files once in a while. .eml is the extension used for files saved as emails from Microsoft outlook or outlook Express. It is normally just a matter of opening these files with gedit as the files are plain text files unless they have attachments. If the attached .eml files themselves have attachments you run into the problem of actually having to open these base64 encoded attachments. The default set of applications in Ubuntu does not directly allow you to do this but there is an easy work around for this problem. Ubuntu Free Software Linux Tips GNU Linux Leave a reply Your email address will not be published. Required fields are marked * Anonymous (not verified) access_time 23 Sep 2019 - 10:34 This tip works very nice on emails where you receive an .eml file as attachment in evolution as well. Only have to scroll down in the message (or viewing pane) to find the option as described. So far I did find only conversion tips by storing the .eml and converting it through Thunderbird till now. Thanx Giannis natsos (not verified) access_time 23 Sep 2019 - 10:34 Open evolution and compose a new mail. Attach the .eml file as an attachment to this mail. Save the mail and close the compose window. Select the mail from the Evolution main window. Below the viewing pane there will be an option to view the attachment inline.download kMail.With left click select KMail. Click on it and enjoy. A.M. (not verified) access_time 23 Sep 2019 - 10:34 Thank you very much, it works! :) jamesc (not verified) access_time 23 Sep 2019 - 10:34 1. From Thunderbird/Evolution/gmail/wherever: Save message (as .eml). 2. $ sudo apt-get install mpack # or equivalent for your OS - install package called "mpack" 3. $ munpack message.eml # bash, multiple files: $ for f in *.eml; do munpack $f; done enzostra (not verified) access_time 23 Sep 2019 - 10:34 In reply to view .eml files (and unpack MIME encoded attachments) by jamesc (not verified) Very useful. It works very well! Thanks. Pagination Current page 1 Page 2 Next page Next › Last page Last » Add new comment
/themes/custom/zyxpro_light/images/placeholder.png
more_horiz
close

on 14th July 2009 / by webmaster
Rar used to be a favorite compression format when the compressed files were to be split into multiple pieces to fit into legacy external storage devices like Floppy, Zip disk, CD etc. WinRAR is a popular GUI application that can rar and unrar files in the rar format. If however you come across rar files that are split into multiple parts then you can extract and combine them as follows Ubuntu Linux Tips GNU Linux Leave a reply Your email address will not be published. Required fields are marked * Anonymous (not verified) access_time 23 Sep 2019 - 10:34 Thanks! DanielRemains (not verified) access_time 23 Sep 2019 - 10:34 Sometimes it's 'part01.rar' and not 'part1.rar'. Thanks for this guide! Pedro (not verified) access_time 23 Sep 2019 - 10:34 Thanks Yasser Zamani (not verified) access_time 23 Sep 2019 - 10:34 Hi, Today when I tried to extract by "Right-Click --> Extract here", it did not work but fortunately I done it in the way you said! Thank you very much! Anonymous (not verified) access_time 23 Sep 2019 - 10:34 :) Pagination Current page 1 Page 2 Next page Next › Last page Last » Add new comment
Leave a reply
Your email address will not be published. Required fields are marked *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.