Good shell sense…

Some good tips to be found for easy command-line editing in your shell.

Chris Lamb on shell use

Some really great tips several of which I’m now using, some I learned from others, but all very useful.

Now in my .bashrc:

alias gps='ps aux | grep $1'
alias gls='ls -la $1 | grep $2'

Surely more as time goes on, but I often grep ps for a pid (or three) and grep ls to avoid scrolling/get rid of the noise.

To clarify his #10, you only type the substitution and it’s applied on the last command and then run. The bash manpage says:

Equivalent to !!:s/string1/string2/

Happy shing.



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.