[plug] Useful command - pstree

Nick Bannon nick at ucc.gu.uwa.edu.au
Thu Apr 19 22:46:51 WST 2001


On Thu, Apr 19, 2001 at 09:08:24PM +0800, Peter Wright wrote:
[Random useful shortcuts]

Here's a few of my favourites:

alias rot13='tr A-Za-z N-ZA-Mn-za-m'

alias unl33t='tr 0341zZUY$ oeaissuys'

# _Very_ handy. Works with any find/xargs, but
# "find ... -print0 | xargs -0 grep" is better, assuming GNU utilities
alias kiboz='find . -type f -print | xargs grep'

# Some zsh-ness to this - easily replaced if desired
alias nx='xterm -sb -ut -fg white -bg black -title ${(C)HOST%%.*}&; disown %?xterm'

# Many variations on a theme are available with this one, as written it
# will print all available entries, including older ones.
alias xtinfo='xauth list | awk ''{print "export DISPLAY=" $1 "; xauth add $DISPLAY " $2 " " $3}'''

# Sort by time, recursively
function latest {
  find $* -printf "%T@ %p\n" | sort -n
}

# Grep arguments from password file
function luser {
  ( L="`grep -i $* /etc/passwd`"
    [ -n "$L" ] && ( echo passwd; echo "$L"; )
    L="`ypcat passwd | grep -i $*`"
    [ -n "$L" ] && ( echo NIS; echo "$L"; )
    L="`nidump passwd . | grep -i $*`"
    [ -n "$L" ] && ( echo Netinfo; echo "$L"; )
  ) 2> /dev/null
}

# When all else fails...
shcat() {
  while test $# -ge 1
  do
    while read i
    do
      echo "$i"
    done < $1
    shift
  done
}

Nick.

-- 
  Nick Bannon  | "I made this letter longer than usual because
nick at it.net.au | I lack the time to make it shorter." - Pascal



More information about the plug mailing list