How To Find Biggest Files On Pc
Every bit a Linux administrator, you lot must periodically check which files and folders are consuming more than deejay space. It is very necessary to notice unnecessary junk and free up them from your hard disk.
This cursory tutorial describes how to detect the largest files and folders in the Linux file arrangement using du (disk usage) and find command. If you want to learn more about these two commands, and so head over to the following articles.
- Learn 10 Useful 'du' (Disk Usage) Commands in Linux
- Master the 'Find' Command with these 35 Applied Examples
How to Find Biggest Files and Directories in Linux
Run the following command to find out meridian biggest directories under /dwelling
partition.
# du -a /domicile | sort -n -r | head -due north 5
The above control displays the biggest 5 directories of my /home partition.
Find Largest Directories in Linux
If you want to display the biggest directories in the current working directory, run:
# du -a | sort -n -r | head -n v
Allow united states break down the command and come across what says each parameter.
-
du
control: Estimate file space usage. -
a
: Displays all files and folders. -
sort
command : Sort lines of text files. -
-due north
: Compare according to string numerical value. -
-r
: Reverse the effect of comparisons. -
caput
: Output the first part of files. -
-n
: Impress the first 'northward' lines. (In our example, Nosotros displayed the first 5 lines).
Some of you would like to display the above consequence in human-readable format. i.e you might desire to display the largest files in KB, MB, or GB.
# du -hs * | sort -rh | head -five
The in a higher place command will show the top directories, which are eating up more deejay space. If y'all feel that some directories are non important, you can simply delete a few sub-directories or delete the entire folder to gratuitous up some infinite.
To brandish the largest folders/files including the sub-directories, run:
# du -Sh | sort -rh | head -v
Find out the meaning of each option using in in a higher place command:
-
du
command: Estimate file space usage. -
-h
: Print sizes in human being-readable format (due east.g., 10MB). -
-Southward
: Practise non include the size of subdirectories. -
-s
: Display but a total for each argument. -
sort
control : sort lines of text files. -
-r
: Reverse the issue of comparisons. -
-h
: Compare human readable numbers (e.thou., 2K, 1G). -
caput
: Output the start part of files.
Find Out Meridian File Sizes Just
If you lot desire to brandish the biggest file sizes but, then run the following command:
# find -blazon f -exec du -Sh {} + | sort -rh | head -n 5
To notice the largest files in a particular location, just include the path beside the find
command:
# find /abode/tecmint/Downloads/ -type f -exec du -Sh {} + | sort -rh | head -northward five OR # discover /domicile/tecmint/Downloads/ -type f -printf "%s %p\n" | sort -rn | head -north 5
The in a higher place command volition brandish the largest file from /habitation/tecmint/Downloads
directory.
That'due south all for now. Finding the biggest files and folders is no big deal. Even a novice administrator can easily find them. If you notice this tutorial useful, delight share information technology on your social networks and support TecMint.
If You Capeesh What Nosotros Practice Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Manufactures, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If y'all similar what you are reading, please consider buying usa a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Source: https://www.tecmint.com/find-top-large-directories-and-files-sizes-in-linux/
Posted by: hillneho1973.blogspot.com
0 Response to "How To Find Biggest Files On Pc"
Post a Comment