Ivan Dives (cottidianus) wrote,
  • Music: Moonspell - Atlantic

Praying to deaf ears.

ps ax | grep "$processName" | grep -v grep | wc -l

People, really. Really, really. Use pgrep, it's good.

pgrep -c "$processName"



$CAT /etc/mtab | $GREP "^$DEVNAME " | $AWK '{ print $2 }' | $GREP "^/media/" || exit

or grep

grep -q "^$DEVNAME /media/" /etc/mtab || exit

or sed (oh I love sed)

sed -n "\:^$DEVNAME /media/:q1" /etc/mtab && exit



fgrep 'model name' /proc/cpuinfo| cat -n | tail -n1

or awk

awk '/model name/ { s=$0; c++ } END { print s " [" c " cores]" }' /proc/cpuinfo
awk '/model name/ { s=$0; c++ } END { printf("%s [%d cores]\n", s, c); }' /proc/cpuinfo
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded  

  • 1 comment