[nycbug-talk] fun one liners

Peter Wright pete at nomadlogic.org
Thu Jun 8 12:28:53 EDT 2006


> On Thu, Jun 08, 2006 at 11:38:27AM -0400, Pete Wright wrote:
>> hey all,
>> so i've been following a thread on the freebsd-stable@ list where a user
>> was having problems finding which files are open by a given process.
>> well...this lead to a lengthy discussion where everyone seemed to reply
>> /usr/port/sysutils/lsof ;)
>>
>> although one guy posted this:
>> % fstat | grep 'httpd.*/var ' | awk '{print $6}' | xargs -n 1 sudo find
>> \
>> -x /var -inum | sort -u
>> %
>>
>> now that's a fun oneliner i've been missing for a while, which leads to
>> think: what other good oneliners do peep's on talk@ have lurking in
>> their
>> $HOME's....
>
> I frequently use:
>
> 	$ du -ks * 2>/dev/null | sort -n
>
> to find out which directories are hogging up the most space.
>
that's pretty good...here's a dumb one for systems without killall built in:

kill -HUP `ps auxww | grep mozilla-bin | awk '{print $2}'| xargs`


not that mozilla crashes frequently viewing java applets or anything ;)

-p


-- 
~~oO00Oo~~
Peter Wright
pete at nomadlogic.org
www.nomadlogic.org/~pete
310.869.9459



More information about the talk mailing list