
Both must be used to get the desired output. Sort has its own built-in function for human-readable numeric sort with -h. No, they don’t because You have only changed the content to human-readable for the du command. Wait a second… Those numbers don’t make any sense. local/share/tracker Corrected Human-Readble Output The human options for certain commands help present numbers in a way that is familiar to us. Let’s clean it up with some more options. That’s better, you can quickly see where the largest files are. Okay, let’s put it all together and see what happens. Otherwise, you may run it, delete several files, but still have space issues. You may want to expand the value to a number greater than 10, or omit it entirely if there are many large files you are trying to filter. This value is something that you should decide based on what you know about the system. I’m also going to add -5 to limit our results further than the default for head. This is what we want when searching for the largest number. Adding -r means that the results will be reversed. So let’s look at what might be more typical options.Īdding -n to sort command means that items will be sorted by numeric value. config/gnome-control-center/backgrounds mozilla/firefox/fault-release/datareportingġ2. Depending on the directory you want to analyze, you can tailor this to find large files quickly. Head here defaults to displaying the first 10 items. 100 is considered less than 12 because 2 > 0. Sort without options arranges items in numerical order, but this behavior is a little strange.

When you run these commands, unless specified with du, everything will run automatically using the current working directory as the source file. What happens if you run these three commands together without options? Your output probably won’t be very useful. There can be several other ways to achieve the same result.

This is just one combination for getting the biggest files and directories in Linux command line. The head command displays the top lines of a text input source. Sort command sorts the data as per your requirement. The du command is used for getting the disk usage.
Linux sequencher files how to#
How to find the biggest folders in Linux? Read the rest of the article to get a detailed explanation of these commands. To find the 10 biggest files and folders in current directory: du -ah | sort -hr | head -n 10 To find the 10 biggest folders in current directory: du -h | sort -hr | head -n 10 This is a quick tutorial to show you how to find the biggest files on your Linux machine using a few commands that you may already be familiar with du, sort, and head.
