1833758 Members
2627 Online
110063 Solutions
New Discussion

File system

 
Indrajit Bhagat
Regular Advisor

File system

To check the disk space,
to check the /tmp, the following command #du -sk *|sort -nr|more.

But for / file system it does not work,
can you suggest me command to to sort the file or folder with greater size.
5 REPLIES 5
Geoff Wild
Honored Contributor

Re: File system

Doesn't work?

Works for me:

root@sha1 [ / ]
# du -sk * |sort -n
0 SD_CDROM
0 bin
0 dvdrom
0 lib
0 lost+found
0 mnt
0 mnt-aix
0 net
0 sha1_xpinfo.csv
0 users
0 {print $2}
8 mapfile
8 sha1.err
8 sha1_xpinfo.txt
8 zmnt
8 zzz
100 dev
128 sha1.txt
144 sha1.html
139992 sbin
184856 etc
217720 tmp
268008 stand
1063160 home
3656416 var
4675736 opt
7918144 usr
15207316 v00


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Robert-Jan Goossens
Honored Contributor

Re: File system

Hi,

# du -kx | sort -rn | more

# find / -type f | -size +10000 -exec ll {} \;

Regards,
Robert-Jan
Hasan  Atasoy
Honored Contributor

Re: File system

du -sx *|sort -nr|more


hasan
Wouter Jagers
Honored Contributor

Re: File system

Hiya,

Because you pipe to sort and more, the output will only show when the complete command has completed.

On the / filesystem this may take a quite a while, depending on your system.. but it should work.

Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
James R. Ferguson
Acclaimed Contributor

Re: File system

Hi:

If you truly want to confine yourself to the '/' filesystem and not visit mountpoints subordinate to it (e.g. /tmp, /var) then you must add the '-x' switch:

# du -xk / | sort -k1,1nr | more

Regards!

...JRF...