Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is awk used for?

1140


What are the differences among a system call, a library function, and a unix command?

1237


Which command should you use to find the remaining disk space in unix server?

1316


Why is awk called awk?

1090


What command is used to switching between users in unix?

1087


What is the use of awk command in unix?

1136


What command is used to check the current users?

1137


What are grep patterns?

1094


What is in grep command?

1181


What is the comma to show the space allocation of files?

1097


How to use grep command to list find the records of a file containing 10 different strings?

1133


Which command is used to delete all files in the current directory and all its sub-directories?

1267


What is the use of egrep command in unix?

1200


What is the command to compare two files in unix?

1127


What is the use of finger command?

1220