how to find largest file?
Answer Posted / souravpoddar
There is no simple command available to find out the largest files/directories on a Linux/UNIX/BSD filesystem. However, combination of following three commands (using pipes) you can easily find out list of largest files:
du command : Estimate file space usage.
sort command : Sort lines of text files or given input data.
head command : Output the first part of files i.e. to display first 10 largest file.
find command : Search file.
Type the following command at the shell prompt to find out top 10 largest file/directories:
# du -a /var | sort -n -r | head -n 10
Sample outputs:
1008372 /var
313236 /var/www
253964 /var/log
192544 /var/lib
152628 /var/spool
152508 /var/spool/squid
136524 /var/spool/squid/00
95736 /var/log/mrtg.log
74688 /var/log/squid
62544 /var/cache
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a command and examples?
What is command substitution?
What does sed command do in unix?
What does 'mkdir' command do in UNIX?
Why is it called a shebang?
How do I open a port?
What does the metacharacter mean?
Which command will print your home directory on screen?
What does find command return in unix?
What is the use of sed command in unix?
How to find $ai_serual resolved path by using unix
What is unix command?
hw will u use awk in replacing cahrs and files
Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.
why metadb requires a seperate slice to create Solaris volume manager