[plug] Useful command - pstree
Peter Wright
pete at cygnus.uwa.edu.au
Thu Apr 19 21:08:24 WST 2001
On Thu, Apr 19, 2001 at 04:27:10PM +0800, Mike Holland wrote:
> On Thu, 19 Apr 2001, Simon Scott wrote:
> > Some commands wired into my brain
[ snip description of Simon's brain wiring ]
> Do you have these wired as shell aliases? e.g.
>
> alias ll='ls -la'
> alias ls='ls -F --color=auto'
> alias tm='tail -f /var/log/messages'
>
> If you are typing somnething often, there is a shortcut.
aliases can be very nice, yes. I also have the ls alias Mike suggests, but
I have a bunch of strange and bizarre others:
----------------------------------------------------------------------
alias la='ls -al'
alias ll='ls -l'
alias l='ls' # Saves a whole 1 character! Woohoo!
alias c='clear'
alias j='jobs'
alias m='mutt -y' # shows status of all mail folders
alias mm='mutt -f ~/Mail/mbox' # reads just personal mail folder
alias s='ls -lt ~/Mail | head -15' # shows (quickly) the most recently
# modified mail folders
alias h='history 1'
# Of course... :)
alias vi='vim'
# Oooh, and a bunch of very useful CVS aliases...
# Note these should not be used without an appropriate ~/.cvsrc
alias cc='cvs commit'
alias cl='cvs log'
alias cs='cvs status'
alias cf='cvs status | grep File:' # great for quickly showing
# modified files
alias cx='cvs diff'
alias cu='cvs update'
----------------------------------------------------------------------
Aliases don't always have to be sophisticated to be useful. All the
one-character aliases above I use very frequently, and it can be disturbing
sometimes when I use a foreign system and realise "oh bugger, that's right,
c has to be _aliased_ to clear first..." :)
> Here are funcs to see today's files, or grep the process list:
>
> lt () { ls -lart $* | grep "`date | cut -c5-10`" }
> psg () { nocorrect ps auwx | grep $* | grep -v "grep $1" }
Not being particularly fluent in shell programs in general - how does the
second one work exactly? Doesn't '$*' represent all arguments/parameters to
the function and '$1' represent the first one? Oh, I get it - grepping out
the grep process, very sneaky.
> The list has been quiet, so why not see some favourite one-liners?
Well I tend towards aliases rather than functions, and you've already seen
all my best ones up above *shuffles feet* Okay, I know they're not _that_
good, but they're useful.... :)
> [disclaimer: your shell may vary. Use the One True Shell - 'zsh']
Om *mumbles meditatively*.
> Mike Holland <mike at golden.wattle.id.au>
Pete.
--
http://cygnus.uwa.edu.au/~pete/
--
hundred-and-one symptoms of being an internet addict:
110. You actually volunteer to become your employer's webmaster.
More information about the plug
mailing list