hb(){ sed "s/\($*\)/`tput setaf 2;tput setab 0;tput blink`\1`tput sgr0`/gI"; }
hb blinks, hc does a reverse color with background.. both very nice.
hc(){ sed "s/\($*\)/`tput setaf 0;tput setab 6`\1`tput sgr0`/gI"; }
Run this:
command ps -Hacl -F S -A f | hc ".*$PPID.*" | hb ".*$$.*"
Your welcome ;)
From my bash profile - http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
4 S root 20159 1610 TS 24 - 1848 stext 2400 0 04:33 ? 0:00 \_ sshd: toor [priv] 5 S toor 20269 20159 TS 21 - 1848 stext 1520 1 04:33 ? 0:00 \_ sshd: toor@pts/0 0 S toor 20273 20269 TS 23 - 1040 wait 2112 2 04:33 pts/0 0:01 \_ -bash 1 S toor 3234 20273 TS 22 - 1040 wait 1100 2 04:38 pts/0 0:00 \_ -bash 0 R toor 3241 3234 TS 21 - 609 - 836 4 04:38 pts/0 0:00 | \_ ps -Hacl -F S -A f 1 S toor 3235 20273 TS 21 - 1040 stext 1096 0 04:38 pts/0 0:00 \_ -bash 1 R toor 3237 3235 TS 20 - 1040 - 1180 6 04:38 pts/0 0:00 | \_ -bash 1 S toor 3236 20273 TS 21 - 1040 wait 1088 2 04:38 pts/0 0:00 \_ -bash 1 S toor 3238 3236 TS 21 - 1040 ? 1180 5 04:38 pts/0 0:00 \_ -bash
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: