Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Largest file in a directory 1

Status
Not open for further replies.

jie

Technical User
Apr 8, 2003
71
US
I would like to ask if there is a command to find the largest file in a directory?

Thanks in advance
 
Hi Jie,
try command
ls -o|awk '{print $4, $8}'|sort -n -r|head -1

regards Boris
 
hi,

you can use the find command and -size option to list files
which are greater than the -size flag e.g.

find directory -type f -size +3000 -ls

-size is in 512 byte blocks


HTH
 
thanks guys .... for your response
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top