{"id":245,"date":"2024-05-06T06:21:12","date_gmt":"2024-05-06T06:21:12","guid":{"rendered":"https:\/\/zalvis.com\/docs\/?p=245"},"modified":"2024-06-23T05:26:27","modified_gmt":"2024-06-23T05:26:27","slug":"how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux","status":"publish","type":"post","link":"https:\/\/zalvis.com\/docs\/how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux.html","title":{"rendered":"How To Find And List Files Bigger Or Smaller Than Specific Size In Linux"},"content":{"rendered":"<div class=\"hkb-article__content\">\n<div class=\"answercell post-layout--right\">\n<div class=\"post-text\">\n<p>This tutorial will explore a list of helpful disk space usage command lines in Linux, with examples of use for each command line.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/zalvis.com\/docs\/how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux.html\/#How_To_Find_And_List_Files_Bigger_Than_100mb_In_Linux\" >How To Find And List Files Bigger Than 100mb In Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/zalvis.com\/docs\/how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux.html\/#How_To_Find_And_List_Files_Bigger_Than_1GB_In_Linux\" >How To Find And List Files Bigger Than 1GB In Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/zalvis.com\/docs\/how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux.html\/#How_To_Find_And_List_Files_Smaller_Than_100mb_In_Linux\" >How To Find And List Files Smaller Than 100mb In Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/zalvis.com\/docs\/how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux.html\/#How_To_Find_And_List_Files_Smaller_Than_1GB_In_Linux\" >How To Find And List Files Smaller Than 1GB In Linux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/zalvis.com\/docs\/how-to-find-and-list-files-bigger-or-smaller-than-specific-size-in-linux.html\/#How_To_Find_And_List_Files_Between_A_Certain_Size_In_Linux\" >How To Find And List Files Between A Certain Size In Linux<\/a><\/li><\/ul><\/nav><\/div>\n<h3 id=\"how-to-find-and-list-files-bigger-than-100mb-in-linux\"><span class=\"ez-toc-section\" id=\"How_To_Find_And_List_Files_Bigger_Than_100mb_In_Linux\"><\/span>How To Find And List Files Bigger Than 100mb In Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you wish to find all files over 100M and to see where they are located and what is their size:<\/p>\n<pre class=\"lang-bsh prettyprint prettyprinted\"><code><span class=\"pln\">find <\/span><span class=\"pun\">.<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">type f <\/span><span class=\"pun\">-<\/span><span class=\"pln\">size <\/span><span class=\"pun\">+<\/span><span class=\"lit\">100M<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">exec ls <\/span><span class=\"pun\">-<\/span><span class=\"pln\">lh <\/span><span class=\"pun\">{}<\/span><span class=\"pln\"> \\;<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<p>I searched files over 100MB in my public_html directory in my below example.<\/p>\n<pre class=\"p1\"><span class=\"s1\">[zalvis@rs-syd public_html]$ find . -type f -size +100M -exec ls -lh {} \\;<\/span>\r\n\r\n<span class=\"s1\">-rw-r--r-- 1 zalvis zalvis 126M Apr<span class=\"Apple-converted-space\">\u00a0 <\/span>1 17:23 .\/screemcast.mov<\/span><\/pre>\n<p>Command-line and each parameter are explained <a href=\"https:\/\/explainshell.com\/explain?cmd=find+.+-type+f+-size+%2B100M+-exec+ls+-lh+%7B%7D+%5C%3B\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">here<\/a>.<\/p>\n<p>You can use size switch for other formats, such as<\/p>\n<ul>\n<li>\u201cc\u201d for bytes<\/li>\n<li>\u201cw\u201d for two-byte words<\/li>\n<li>\u201ck\u201d for Kilobytes<\/li>\n<li>\u201cM\u201d for Megabytes<\/li>\n<li>\u201cG\u201d for Gigabytes<\/li>\n<\/ul>\n<h3 id=\"how-to-find-and-list-files-bigger-than-1gb-in-linux\"><span class=\"ez-toc-section\" id=\"How_To_Find_And_List_Files_Bigger_Than_1GB_In_Linux\"><\/span>How To Find And List Files Bigger Than 1GB In Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For example, to find files that are bigger than 1GB, use the following command:<\/p>\n<p><code><span class=\"pln\">find <\/span><span class=\"pun\">.<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">type f <\/span><span class=\"pun\">-<\/span><span class=\"pln\">size <\/span><span class=\"pun\">+<\/span><span class=\"lit\">1G<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">exec ls <\/span><span class=\"pun\">-<\/span><span class=\"pln\">lh <\/span><span class=\"pun\">{}<\/span><span class=\"pln\"> \\;<\/span><\/code><\/p>\n<h3 id=\"how-to-find-and-list-files-smaller-than-100mb-in-linux\"><span class=\"ez-toc-section\" id=\"How_To_Find_And_List_Files_Smaller_Than_100mb_In_Linux\"><\/span>How To Find And List Files Smaller Than 100mb In Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"answercell post-layout--right\">\n<div class=\"post-text\">\n<p>If you wish to find all files under 100M and to see where they are located and what is their size:<\/p>\n<pre class=\"lang-bsh prettyprint prettyprinted\"><code><span class=\"pln\">find <\/span><span class=\"pun\">.<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">type f <\/span><span class=\"pun\">-<\/span><span class=\"pln\">size -<\/span><span class=\"lit\">100M<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">exec ls <\/span><span class=\"pun\">-<\/span><span class=\"pln\">lh <\/span><span class=\"pun\">{}<\/span><span class=\"pln\"> \\;<\/span><\/code><\/pre>\n<\/div>\n<\/div>\n<p>In my below example, I searched files over 100MB in my public_html directory.<\/p>\n<pre class=\"p1\"><span class=\"s1\">[zalvis@rs-syd public_html]$ find . -type f -size -100M -exec ls -lh {} \\;<\/span>\r\n\r\n<span class=\"s1\">-rw-r--r-- 1 zalvis zalvis 56M Apr<span class=\"Apple-converted-space\">\u00a0 <\/span>1 17:23 .\/screemcast.mov<\/span><\/pre>\n<p>Command-line and each parameter explained <a href=\"https:\/\/explainshell.com\/explain?cmd=find+.+-type+f+-size+%2B100M+-exec+ls+-lh+%7B%7D+%5C%3B\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">here<\/a>.<\/p>\n<p>You can use size switch for other formats, such as<\/p>\n<ul>\n<li>\u201cc\u201d for bytes<\/li>\n<li>\u201cw\u201d for two-byte words<\/li>\n<li>\u201ck\u201d for Kilobytes<\/li>\n<li>\u201cM\u201d for Megabytes<\/li>\n<li>\u201cG\u201d for Gigabytes<\/li>\n<\/ul>\n<h3 id=\"how-to-find-and-list-files-smaller-than-1gb-in-linux\"><span class=\"ez-toc-section\" id=\"How_To_Find_And_List_Files_Smaller_Than_1GB_In_Linux\"><\/span>How To Find And List Files Smaller Than 1GB In Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For example, to find files which are smaller than 1GB, use the following command:<\/p>\n<p><code><span class=\"pln\">find <\/span><span class=\"pun\">.<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">type f <\/span><span class=\"pun\">-<\/span><span class=\"pln\">size -<\/span><span class=\"lit\">1G<\/span> <span class=\"pun\">-<\/span><span class=\"pln\">exec ls <\/span><span class=\"pun\">-<\/span><span class=\"pln\">lh <\/span><span class=\"pun\">{}<\/span><span class=\"pln\"> \\;<\/span><\/code><\/p>\n<h3 id=\"how-to-find-and-list-files-between-a-certain-size-in-linux\"><span class=\"ez-toc-section\" id=\"How_To_Find_And_List_Files_Between_A_Certain_Size_In_Linux\"><\/span>How To Find And List Files Between A Certain Size In Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You might wonder how to find and list files between a certain size. For instance, you can find files <strong>between 100MB and 500MB<\/strong>\u00a0using the following command:<\/p>\n<pre>find . -type f -size +100M -size -500M -exec ls -l {} +<\/pre>\n<p>You can use size switch for other formats, such as<\/p>\n<ul>\n<li>\u201cc\u201d for bytes<\/li>\n<li>\u201cw\u201d for two-byte words<\/li>\n<li>\u201ck\u201d for Kilobytes<\/li>\n<li>\u201cM\u201d for Megabytes<\/li>\n<li>\u201cG\u201d for Gigabytes<\/li>\n<\/ul>\n<\/div>\n<div class=\"jczgo69f31a4c9e63a\" >If you enjoyed this article, then you\u2019ll love Zalvis's Cloud Hosting platform. Turbocharge your website and get 24\/7 support from our veteran team. Our world-class hosting infrastructure focuses on auto-scaling, performance, and security. Let us show you the Zalvis difference! <a href=\"https:\/\/zalvis.com\/\">Check out our services.<\/a><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.jczgo69f31a4c9e63a {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.jczgo69f31a4c9e63a {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.jczgo69f31a4c9e63a {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.jczgo69f31a4c9e63a {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.jczgo69f31a4c9e63a {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will explore a list of helpful disk space usage command lines in Linux, with examples of use for each command line. How To Find And List Files Bigger Than 100mb In Linux If you wish to find all files over 100M and to see where they are located and what is their size: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-245","post","type-post","status-publish","format-standard","hentry","category-server-setup"],"_links":{"self":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/comments?post=245"}],"version-history":[{"count":2,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/245\/revisions"}],"predecessor-version":[{"id":247,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/posts\/245\/revisions\/247"}],"wp:attachment":[{"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/media?parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/categories?post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zalvis.com\/docs\/wp-json\/wp\/v2\/tags?post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}