1845033 Members
2009 Online
110233 Solutions
New Discussion

Script help

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

Script help

Ok, Im stuck here. Im not a great script creator.
After I run this script I wrote that looks for directoris with lots of files, I end up with this listing. ist column being the number of files in that die, the second column being the directory name:
3088 /zones/s1dfa89/root/usr/share/man/man3mlib
how can I read the file and just pull out the lines that are over 3000?
UNIX IS GOOD
5 REPLIES 5
Jeff_Traigle
Honored Contributor
Solution

Re: Script help

awk '{if ($1 > 3000) print}' datafile
--
Jeff Traigle
Nobody's Hero
Valued Contributor

Re: Script help

Thanks, Im a stupe sometimes:

UNIX IS GOOD
Robert-Jan Goossens
Honored Contributor

Re: Script help

grep 3[0-9][0-9][0-9] file

Robert-Jan
Hein van den Heuvel
Honored Contributor

Re: Script help

And for the lazy, or poorly typing, folks:

awk '$1>3000' your-file



0 points for this please.

Cheers,
Hein.
Peter Nikitka
Honored Contributor

Re: Script help

Hi,

... and if you just need the filename(s) for further processing:
awk '$1>3000 {print $2}' listing-file

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"