Operating System - HP-UX
1822293 Members
3991 Online
109642 Solutions
New Discussion юеВ

Re: how do I check what are the biggest files in /var & its subdirectories

 
SOLVED
Go to solution
Ravinder Singh Gill
Regular Advisor

how do I check what are the biggest files in /var & its subdirectories

how do I check what are the biggest files in /var & its subdirectories

i know its the du command but with what options?
13 REPLIES 13
Joseph Loo
Honored Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

hi,

try:

# du -ka|sort -rnk1|more

regards.
what you do not see does not mean you should not believe
vinod_25
Valued Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

hi ravinder

try this

find /var -size +5000000c -xdev -exec ll {} \;

where the files more than 5MB will be listed below directories and subdirectories of var
you can use du command also

cd /var
du -ks * |sort -rn |head

Good luck

Vinod
Fabio Ettore
Honored Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

Hi,

try too:
du -kx /var | sort -rn | more

Best regards,
Fabio
WISH? IMPROVEMENT!
Pete Randall
Outstanding Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

Unfortunately, there is no -r (recursive) option to du, so you have to do it manually, searching at the top directory level and then working your way down. The only other way would be to combine find and du like this:

find /var -type d |xargs du -sk |sort -n

That might work.


Pete

Pete
Sudeesh
Respected Contributor
Solution

Re: how do I check what are the biggest files in /var & its subdirectories

another option:
find /var -size +10000000c -exec ll {} \; |more

will list all files having size more than 100MB.


Sudeesh
The most predictable thing in life is its unpredictability
Ravinder Singh Gill
Regular Advisor

Re: how do I check what are the biggest files in /var & its subdirectories

it said

root@hp10:/var -: find /var -size +10000000c -exec || {}\;|more
find: -exec requires an argument
sh: {};: not found.
Joseph Loo
Honored Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

hi,

it should be:

# find /var -size +10000000c -exec ls -ld {}\;

regards.
(p.s. please remember to assign points.)
what you do not see does not mean you should not believe
Joseph Loo
Honored Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

type too fast, correct syntax:

# find /var -size +10000000c -exec ls -ld {} \;

du command may be use as well.

regards.
what you do not see does not mean you should not believe
Muthukumar_5
Honored Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

Try as,

find /var \( -type f -o -type d \) -exec du -k {} \+ | sort -rn | more

hth.
Easy to suggest when don't know about the problem!
MarkSyder
Honored Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

It looks to me as if you've typed || (pipes) instead of ll (letters).

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Cem Tugrul
Esteemed Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

Hi,
Another solution from me;

cd var;
find . -type f -exec ls -lrt {} \;|sort +4n

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Pradeep_29
Frequent Advisor

Re: how do I check what are the biggest files in /var & its subdirectories

Simple command which I prefer always...

"du -x | sort -n"

~Pradeep.
Sudeesh
Respected Contributor

Re: how do I check what are the biggest files in /var & its subdirectories

Ravinder,
Probably you missed a space.

find/var-size +10000000c-execll{}\;|more

find /var -size +1000000c -exec ll {} \;|more
-rw-r--r-- 1 root sys 1094905 Jul 9 07:25 /var/adm/sw/products/I
NDEX
-r--r--r-- 1 bin bin 1168874 Jun 12 2003 /var/stm/data/eventdef
-r-xr-xr-- 1 bin bin 2280478 Mar 17 2003 /var/stm/data/tools/ve
rify/trap_big.bm



Sudeesh
The most predictable thing in life is its unpredictability