{"id":2558,"date":"2023-06-17T09:10:09","date_gmt":"2023-06-17T09:10:09","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=2558"},"modified":"2023-06-17T09:12:21","modified_gmt":"2023-06-17T09:12:21","slug":"sort-files-by-size-in-linux-unix","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/","title":{"rendered":"How to Sort Files by Size in Linux\/Unix?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Sorting files in regard to their size can be easily done by using the \u201cls\u201d command and by adding specific flag options. Alternatively, you can also use other available commands or the GUI to sort files in a Linux-based or a Unix-based operating system.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When working with Linux Directories, especially on a server machine, sorting files in a specific order is super helpful as it allows you to organize files in a manner that a single glance can interpret.\u00a0<\/span><\/p>\n\n<p><span style=\"font-weight: 400;\">Let\u2019s get started with the first method!<\/span><\/p>\n<h2 id=\"how-to-sort-files-in-linux-using-the-ls-command-with-s-option\"><span style=\"font-weight: 400;\">How to Sort Files in Linux Using the ls Command with -S Option?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The first method revolves around the list show command \u201cls\u201d and an optional flag \u201c<\/span><b>-S<\/b><span style=\"font-weight: 400;\">.\u201d The \u201c<\/span><b>-S<\/b><span style=\"font-weight: 400;\">\u201d sorts the files according to their file\/directory size.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To showcase, first, get the normal \u201cls\u201d command output by typing <\/span><b>ls <\/b><span style=\"font-weight: 400;\">in a terminal session. Doing this will display the following output on the terminal:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/1-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2561\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/1-3.png\" alt=\"\" width=\"973\" height=\"141\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/1-3.png 973w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/1-3-300x43.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/1-3-768x111.png 768w\" sizes=\"auto, (max-width: 973px) 100vw, 973px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Currently, the output only shows the names of the file. However, before using the sort option, use the \u201c<\/span><b>-l<\/b><span style=\"font-weight: 400;\">\u201d to display the properties of files in the output:<\/span><\/p>\n<pre>ls -l<\/pre>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/2-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2562\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/2-3.png\" alt=\"\" width=\"968\" height=\"314\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/2-3.png 968w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/2-3-300x97.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/2-3-768x249.png 768w\" sizes=\"auto, (max-width: 968px) 100vw, 968px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">In the output image above, you can see the size of each file in the fourth column. Currently, it is not sorted. To sort this out, let\u2019s add the \u201c-S\u201d flag option and the \u201c<\/span><b>-l<\/b><span style=\"font-weight: 400;\">\u201d option.<\/span><\/p>\n<pre>ls -lS<\/pre>\n<p><span style=\"font-weight: 400;\">You will get the following out on the terminal:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/3-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2563\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/3-3.png\" alt=\"\" width=\"969\" height=\"495\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/3-3.png 969w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/3-3-300x153.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/3-3-768x392.png 768w\" sizes=\"auto, (max-width: 969px) 100vw, 969px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">You can clearly see that the output\u2019s order has been changed according to the size of the files in the current directory.<\/span><\/p>\n<h2 id=\"how-to-sort-files-in-reverse-order-with-ls-command\"><span style=\"font-weight: 400;\">How to Sort Files in Reverse Order With ls Command?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To sort files in reverse in Linux or Unix-based operating Systems, you can use the \u201c<\/span><b>-r<\/b><span style=\"font-weight: 400;\">\u201d with the <\/span><b>ls<\/b><span style=\"font-weight: 400;\"> command and the \u201c-S\u201d flag. The <\/span><b>-r<\/b><span style=\"font-weight: 400;\"> flag stands for reversing the output of the command.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Type the following command in a terminal window:<\/span><\/p>\n<pre>ls -lSr<\/pre>\n<p><span style=\"font-weight: 400;\">This will return the following output on the terminal window:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/4-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2564\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/4-3.png\" alt=\"\" width=\"963\" height=\"261\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/4-3.png 963w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/4-3-300x81.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/4-3-768x208.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">As you can see, the files are now sorted and displayed in the reverse order. If you want to minimize the output on the terminal, then you can remove the <\/span><b>-l<\/b><span style=\"font-weight: 400;\">. Executing the following command in a terminal window:<\/span><\/p>\n<pre>ls -Sr<\/pre>\n<p><span style=\"font-weight: 400;\">You will get the following command on the terminal window:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/5-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2565\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/5-3.png\" alt=\"\" width=\"875\" height=\"85\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/5-3.png 875w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/5-3-300x29.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/5-3-768x75.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">You have successfully sorted the files in a directory in the reverse order.<\/span><\/p>\n<h2 id=\"affordable-vps-hosting-with-dracula-servers\"><span style=\"font-weight: 400;\">Affordable VPS Hosting With Dracula Servers<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Dracula Servers offers high-performance server hosting at entry-level prices. The plans include Linux VPS, Sneaker Servers, Dedicated Servers &amp; turnkey solutions. If you&#8217;re looking for quality self-managed servers with high amounts of RAM and storage, look no further.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Dracula Server Hosting is also Perfect for Hosting Telegram.Forex App with built-in support for MT4 with trade copier. Check the plans for yourself by clicking <\/span><a href=\"https:\/\/draculaservers.com\/#pick-plan\"><span style=\"font-weight: 400;\">Here<\/span><\/a><span style=\"font-weight: 400;\">!<\/span><\/p>\n<h2 id=\"how-to-sort-files-using-the-sort-option-with-the-ls-command\"><span style=\"font-weight: 400;\">How to Sort Files Using the &#8211;sort Option With the ls Command?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Using the <\/span><b>&#8211;sort=size<\/b><span style=\"font-weight: 400;\"> option within the <\/span><b>ls<\/b><span style=\"font-weight: 400;\"> command is an alternative to the <\/span><b>-S<\/b><span style=\"font-weight: 400;\"> flag. The result of this command will display the files in ascending order according to their file size.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Type the following command in the terminal window:<\/span><\/p>\n<pre>ls --sort=size<\/pre>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/6-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2566\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/6-3.png\" alt=\"\" width=\"964\" height=\"264\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/6-3.png 964w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/6-3-300x82.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/6-3-768x210.png 768w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">In the output screenshot, you can clearly see that the files are now sorted according to their file size.<\/span><\/p>\n<h2 id=\"how-to-sort-files-and-display-results-in-human-readable-format\"><span style=\"font-weight: 400;\">How to Sort Files and Display Results in Human-Readable Format?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To get the output of the sort option in the <\/span><b>ls <\/b><span style=\"font-weight: 400;\">command, you can use the <\/span><b>-h<\/b><span style=\"font-weight: 400;\"> flag. The <\/span><b>-h<\/b><span style=\"font-weight: 400;\"> returns the size output in a human-readable format by mentioning K for kilobytes and M for megabytes next to the file size.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s take an example to showcase the working of the -h flag. First, get the output of the sort in <\/span><b>ls<\/b><span style=\"font-weight: 400;\"> command of the directory by typing \u201c<\/span><b>ls -lS<\/b><span style=\"font-weight: 400;\">\u201d:<\/span><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/7-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2567\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/7-3.png\" alt=\"\" width=\"964\" height=\"412\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/7-3.png 964w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/7-3-300x128.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/7-3-768x328.png 768w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">The size in the output displays the total number of bytes each file is taking in the disk. Even the total size value is not readable-friendly. Now, use the <\/span><b>-h<\/b><span style=\"font-weight: 400;\"> flag:<\/span><\/p>\n<pre>ls -lhS<\/pre>\n<p><span style=\"font-weight: 400;\">Executing this command will display the following output on the terminal:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/8-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2568\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/8-3.png\" alt=\"\" width=\"974\" height=\"364\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/8-3.png 974w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/8-3-300x112.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/8-3-768x287.png 768w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">As you can see from the output, the size is now represented in Megabytes by placing the letter M next to it. It is very easy to deduce that the total size in the current directory is 148 MBs. The size values without any letters mean KBs.<\/span><\/p>\n<h2 id=\"how-to-sort-files-and-hidden-files-in-linux-unix\"><span style=\"font-weight: 400;\">How to Sort Files and Hidden Files in Linux \/ Unix?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If you want to sort the files and display them in order which also includes the hidden files and the hidden directories, then you can use the <\/span><b>-a<\/b><span style=\"font-weight: 400;\"> flag in the \u201cls -lS\u201d command. Therefore, in the terminal of the current working directory, simply type the following command:<\/span><\/p>\n<pre>ls -laS<\/pre>\n<p><span style=\"font-weight: 400;\">Once you execute this command, you will get the following output on the terminal window:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/9-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2569\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/9-3.png\" alt=\"\" width=\"970\" height=\"489\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/9-3.png 970w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/9-3-300x151.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/9-3-768x387.png 768w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">This time around, the output contains the hidden directories. If there are any other hidden files or directories, they will also be listed in the output of this command.<\/span><\/p>\n<h2 id=\"how-to-sort-files-using-the-du-and-sort-command-in-linux\"><span style=\"font-weight: 400;\">How to Sort Files Using the du and sort Command in linux?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">You can also use the du command to list the size of all the files in the present working directory and then sort them using the sort command. To demonstrate this, simply type the following command in the terminal:<\/span><\/p>\n<pre>du -hs * | sort -h<\/pre>\n<p><span style=\"font-weight: 400;\">Executing this command will display the following output on the terminal:<\/span><\/p>\n<p><a href=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/10-3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2570\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/10-3.png\" alt=\"\" width=\"962\" height=\"391\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/10-3.png 962w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/10-3-300x122.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/10-3-768x312.png 768w\" sizes=\"auto, (max-width: 962px) 100vw, 962px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">The benefit of using the <\/span><b>du<\/b><span style=\"font-weight: 400;\"> and <\/span><b>sort<\/b><span style=\"font-weight: 400;\"> command over the <\/span><b>ls <\/b><span style=\"font-weight: 400;\">command is that this command displays only the names of the files and their file size. Moreover, the output is already in a readable-friendly format.<\/span><\/p>\n<h2 id=\"wrap-up\"><span style=\"font-weight: 400;\">Wrap up<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To sort files in Linux \/ Unix-based operating systems, you can use the ls command with the \u201c<\/span><b>-S<\/b><span style=\"font-weight: 400;\">\u201d flag. The <strong>-S<\/strong> flag means to sort, which will sort the files in ascending order according to their file size.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, to get a better-formatted output, you can use the <\/span><b>-l<\/b><span style=\"font-weight: 400;\"> flag to list the details of the files, the <\/span><b>-h<\/b><span style=\"font-weight: 400;\"> flag to have a more readable output in which size is displayed as MBs and KBs, and the <\/span><b>-a<\/b><span style=\"font-weight: 400;\"> flag to include the hidden files in the output as well. Lastly, another method is to combine the <\/span><b>du<\/b><span style=\"font-weight: 400;\"> command and the <\/span><b>sort<\/b><span style=\"font-weight: 400;\"> command.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.<\/p>\n","protected":false},"author":4,"featured_media":2573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2],"tags":[145,144,102,34,143],"class_list":["post-2558","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-getting-started","category-linux-basics","tag-file-management","tag-file-sort","tag-linux","tag-ubuntu","tag-unix"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png",1280,720,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_-300x169.png",300,169,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_-768x432.png",768,432,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_-1024x576.png",1024,576,true],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png",1280,720,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png",1280,720,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/getting-started\/\" rel=\"category tag\">Getting Started<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/linux-basics\/\" rel=\"category tag\">Linux Basics<\/a>","author_info_v2":{"name":"Abdul Mannan","url":"https:\/\/draculaservers.com\/tutorials\/author\/abdul-mannan-tbgmail-com\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Sort Files by Size in Linux\/Unix? - Dracula Servers Tutorials<\/title>\n<meta name=\"description\" content=\"To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Sort Files by Size in Linux\/Unix? - Dracula Servers Tutorials\" \/>\n<meta property=\"og:description\" content=\"To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-17T09:10:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-06-17T09:12:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abdul Mannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdul Mannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\"},\"headline\":\"How to Sort Files by Size in Linux\\\/Unix?\",\"datePublished\":\"2023-06-17T09:10:09+00:00\",\"dateModified\":\"2023-06-17T09:12:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/\"},\"wordCount\":1009,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/How-to-Sort-Files-by-Size-in-Linux_.png\",\"keywords\":[\"File management\",\"File Sort\",\"linux\",\"Ubuntu\",\"Unix\"],\"articleSection\":[\"Getting Started\",\"Linux Basics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/\",\"name\":\"How to Sort Files by Size in Linux\\\/Unix? - Dracula Servers Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/How-to-Sort-Files-by-Size-in-Linux_.png\",\"datePublished\":\"2023-06-17T09:10:09+00:00\",\"dateModified\":\"2023-06-17T09:12:21+00:00\",\"description\":\"To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/How-to-Sort-Files-by-Size-in-Linux_.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/How-to-Sort-Files-by-Size-in-Linux_.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/sort-files-by-size-in-linux-unix\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Sort Files by Size in Linux\\\/Unix?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\",\"name\":\"Abdul Mannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"caption\":\"Abdul Mannan\"},\"description\":\"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Sort Files by Size in Linux\/Unix? - Dracula Servers Tutorials","description":"To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/","og_locale":"en_US","og_type":"article","og_title":"How to Sort Files by Size in Linux\/Unix? - Dracula Servers Tutorials","og_description":"To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.","og_url":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2023-06-17T09:10:09+00:00","article_modified_time":"2023-06-17T09:12:21+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png","type":"image\/png"}],"author":"Abdul Mannan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdul Mannan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6"},"headline":"How to Sort Files by Size in Linux\/Unix?","datePublished":"2023-06-17T09:10:09+00:00","dateModified":"2023-06-17T09:12:21+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/"},"wordCount":1009,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png","keywords":["File management","File Sort","linux","Ubuntu","Unix"],"articleSection":["Getting Started","Linux Basics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/","url":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/","name":"How to Sort Files by Size in Linux\/Unix? - Dracula Servers Tutorials","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png","datePublished":"2023-06-17T09:10:09+00:00","dateModified":"2023-06-17T09:12:21+00:00","description":"To sort files in Linux, use the ls command with the -S flag. You can also use the du and sort command in combination.","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2023\/06\/How-to-Sort-Files-by-Size-in-Linux_.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/sort-files-by-size-in-linux-unix\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How to Sort Files by Size in Linux\/Unix?"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6","name":"Abdul Mannan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","caption":"Abdul Mannan"},"description":"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot."}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=2558"}],"version-history":[{"count":3,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2558\/revisions"}],"predecessor-version":[{"id":2571,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/2558\/revisions\/2571"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/2573"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=2558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=2558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=2558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}