Top 5 biggest file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Top 5 biggest file
# 1  
Old 12-18-2009
Top 5 biggest file

Hi ,
I need to get a list of name and size , of the the top 5 biggest file under the
current directory , in decending order
Thank You
# 2  
Old 12-18-2009
Code:
du -ah . | sort -n -r  | head -n 5

# 3  
Old 12-18-2009
Code:
du -ak . |sort -n|tail -5


Last edited by ichigo; 12-18-2009 at 02:32 AM..
# 4  
Old 12-18-2009
Thanks.

du -ah . | sort -n -r | head -n 5

I seems that its does not take into consideration files that exists under subdirectories
# 5  
Old 12-18-2009
Code:
gnu_find /path -type f -printf "%s|%p\n"|sort -n|tail -5

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX commands to display the biggest file by size in a directory

Hello guys, Please i need to know the biggest files in my directory let's say$ >du -h | egrep 'M|G|G' 195M ./TMP 3.6M ./TP_DEC2012 146G . But here the result it's giving me the biggest directory in the path. Actually i want to know the biggest file in 146G . Can anyone... (6 Replies)
Discussion started by: gillesi
6 Replies

2. Shell Programming and Scripting

How to find biggest word in a file....?

With any cmd like sed grep ask etc... (1 Reply)
Discussion started by: sidpatil
1 Replies

3. Shell Programming and Scripting

find biggest number inside file

Hi, I wanna find the biggest number inside of a file this is kind of example of file: 9 11 55 then i just wanna print out the biggest number i had try sed filenale | sort -k1,1n | paste -s -d',' - but i had no success ... (7 Replies)
Discussion started by: prpkrk
7 Replies

4. Shell Programming and Scripting

help to get the biggest partition with awk

# fdisk -l /dev/sda Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk... (9 Replies)
Discussion started by: yanglei_fage
9 Replies

5. HP-UX

Biggest files on FS /

Hi! I'm using Unix HP I'm looking for a command which find the 20 (less or more) biggest files on / but which exclude every other files system Thanks;) (7 Replies)
Discussion started by: Castelior
7 Replies

6. Shell Programming and Scripting

Script to check top 5 biggest disk space users

Hi all, I am needing a bash shell script to generate a list of the top 5 users using the most disk space. I am thinking that the du command would be used somehow but I am at a loss. Can anyone help? Thanks! (3 Replies)
Discussion started by: sytemx
3 Replies

7. UNIX for Dummies Questions & Answers

Disk Usage in GB and Unix command to find the biggest file/folder

Hi All, Please help me out 1) Command to find the disk usage in GB. I know that du -k will give in kilobites. 2) How to find the Biggest file/folder in a given set of files/folders. Thanks in advance Regards, Manas (8 Replies)
Discussion started by: manas6
8 Replies

8. Shell Programming and Scripting

finding biggest number

I think my script is working but i am trying to understand while I am tracing to see if it's realli working.. can somebody please comment.. also. is there different way to write this in shell? sh -x findbiggestnum 1 2 3 + big=0 + big=1 + big=2 + big=3 + echo 3 3 big=0 ... (3 Replies)
Discussion started by: hankooknara
3 Replies

9. Solaris

top biggest files

hi all, is there any way how i can output the top 10-30 biggest files for all filesystem? using du -sh * is quite tedious since i have to move from 1 directory at a time. thanks (3 Replies)
Discussion started by: 3rr0r_3rr0r
3 Replies

10. UNIX for Dummies Questions & Answers

The biggest newb ever...

Hi, all you unix people. I am a pretty advanced windows user, but I am curious about unix. Is there any reason I should attempt to acquire some form of unix for my home computer system? What sort of things is unix useful for? Unix is open source, right? Assuming that to be the case, I infer that... (3 Replies)
Discussion started by: BoneMalone
3 Replies
Login or Register to Ask a Question