{"id":2966,"date":"2020-04-01T08:05:18","date_gmt":"2020-04-01T08:05:18","guid":{"rendered":"https:\/\/chemicloud.com\/kb\/?post_type=ht_kb&#038;p=2966"},"modified":"2022-04-13T10:39:23","modified_gmt":"2022-04-13T10:39:23","slug":"find-and-list-files-bigger-or-smaller-than-in-linux","status":"publish","type":"ht_kb","link":"https:\/\/chemicloud.com\/kb\/article\/find-and-list-files-bigger-or-smaller-than-in-linux\/","title":{"rendered":"How to Find and List Files Bigger or Smaller Than Specific Size in Linux"},"content":{"rendered":"<div class=\"votecell post-layout--left\">\n<div class=\"js-voting-container grid fd-column ai-stretch gs4 fc-black-200\" data-post-id=\"757143\"><\/div>\n<\/div>\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<h3 id=\"how-to-find-and-list-files-bigger-than-100mb-in-linux\">How to find and list files bigger than 100mb in Linux<\/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\">[chemiccl@rs-syd public_html]$ find . -type f -size +100M -exec ls -lh {} \\;<\/span>\r\n\r\n<span class=\"s1\">-rw-r--r-- 1 chemiccl chemiccl 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>&#8220;c&#8221; for bytes<\/li>\n<li>&#8220;w&#8221; for two-byte words<\/li>\n<li>&#8220;k&#8221; for Kilobytes<\/li>\n<li>&#8220;M&#8221; for Megabytes<\/li>\n<li>&#8220;G&#8221; for Gigabytes<\/li>\n<\/ul>\n<h3 id=\"how-to-find-and-list-files-bigger-than-1gb-in-linux\">How to find and list files bigger than 1GB in Linux<\/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\">How to find and list files smaller than 100mb in Linux<\/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\">[chemiccl@rs-syd public_html]$ find . -type f -size -100M -exec ls -lh {} \\;<\/span>\r\n\r\n<span class=\"s1\">-rw-r--r-- 1 chemiccl chemiccl 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>&#8220;c&#8221; for bytes<\/li>\n<li>&#8220;w&#8221; for two-byte words<\/li>\n<li>&#8220;k&#8221; for Kilobytes<\/li>\n<li>&#8220;M&#8221; for Megabytes<\/li>\n<li>&#8220;G&#8221; for Gigabytes<\/li>\n<\/ul>\n<p><b>Tired of hassling with website issues?<span class=\"Apple-converted-space\">\u00a0 <\/span>ChemiCloud is the managed hosting solution designed to save you time and money! <\/b>\ud83e\udd13<b> Check out our <\/b><span style=\"text-decoration: underline;\"><a href=\"https:\/\/chemicloud.com\/pricing#60b65e4e63b58\" target=\"_blank\" rel=\"noopener\"><span class=\"s1\"><b>web hosting <\/b><\/span><\/a><\/span><b>plans!<\/b><\/p>\n<h3 id=\"how-to-find-and-list-files-smaller-than-1gb-in-linux\">How to find and list files smaller than 1GB in Linux<\/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\">How to find and list files between a certain size in Linux<\/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>&#8220;c&#8221; for bytes<\/li>\n<li>&#8220;w&#8221; for two-byte words<\/li>\n<li>&#8220;k&#8221; for Kilobytes<\/li>\n<li>&#8220;M&#8221; for Megabytes<\/li>\n<li>&#8220;G&#8221; for Gigabytes<\/li>\n<\/ul>\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&#8230;<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"ht-kb-category":[188],"ht-kb-tag":[],"class_list":["post-2966","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-support-resources"],"_links":{"self":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/2966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/comments?post=2966"}],"version-history":[{"count":10,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/2966\/revisions"}],"predecessor-version":[{"id":7373,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb\/2966\/revisions\/7373"}],"wp:attachment":[{"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/media?parent=2966"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-category?post=2966"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/chemicloud.com\/kb\/wp-json\/wp\/v2\/ht-kb-tag?post=2966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}