[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] useful one liners



On Thu, 31 Aug 2000, cLive hoLLoway wrote:

> Eg,
> 
> get a nicely formatted e-mail of all your site mappings:
> 
> perl -e 'for (split /\n/, `ls -l /home/sites`) { /(\S*) -> (\S*)/; print
> "$2 -> $1\n" if $2; }' |/bin/mail your@xxxxxxxxxxxxxxxx
> 
> shows path first.

You could also phrase that as:

~$ ls -l /home/sites | \
	perl -ane 'if ($#F == 10) { print reverse "\n", @F[8..10] }' | \
	/bin/mail email@address

;-)

> PS - while on the subject, does anyone have a good one liner for listing
> all files owned by a particular user?

You don't need a one liner for that, just the standard 'find' command.  Check
out the man pages, you can search on any and all file attributes, as well as
much fancier criteria.  :-)

	--Arthur Corliss
	  Bolverk's Lair -- http://www.odinicfoundation.org/arthur/
	  "Live Free or Die, the Only Way to Live" -- NH State Motto