1846449 Members
2837 Online
110256 Solutions
New Discussion

Re: /usr

 
subhashni
Regular Advisor

/usr

Hi Guys,
I have /usr as 92% used in my J machine.I would like to find out which file is occuping more space.If i use sort then what will be the exact syntax.Please help.
Thanks
unix4me
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: /usr

Example to list all files in /usr which are bigger than say .. 2MB, you can run ..

# cd /usr
# find . -size +2000000c

Also look for core files ..

# find . -name core
A. Clay Stephenson
Acclaimed Contributor

Re: /usr

Hi:

It's much better and faster to use du and sort in reverse numerical order to find large directories and then drill down.

du -k /usr | sort -n -r | pg
If it ain't broke, I can fix that.
Helen French
Honored Contributor

Re: /usr

Hi,

Try this:

# cd dir_path
# du -k | sort -rn

This will list you the biggest files/directories in Kbytes.

Also you can try find command:

# find . -xdev -size +10000 -exec ll {} \; > /tmp/bigfiles


HTH,
Shiju
Life is a promise, fulfill it!
Jeff Schussele
Honored Contributor

Re: /usr

If you have anything mounting below /usr you can restrict du with -x

du -akx | sort -nr | more

This will keep output to the /usr FS only.

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Sanjay_6
Honored Contributor

Re: /usr

Hi Subhashni,

Try this,

cd /usr
du -k .

You can sort this output. Check for log files not cleared. You may have huge log files.

Look for core files,

find /usr -name core -exec ll {} \;

Remove core files from /usr,

find /usr -name core -exec rm {} \;

Hope this helps.

regds
subhashni
Regular Advisor

Re: /usr

guys,
All your suggesstions are useful.Thanks.
unix4me