Comments on Command line aliases in the Linux Shell

In this fourth and the final installment, we will discuss the concept of aliases as well how you can use them to make your command line navigation easier and smoother.

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Anonymous

 Thanks! I enjoyed reading these articles.

By: Anonymous

 If these comments need to be manually approved, why is the captcha necessary (I especially hate recaptcha's ones).

By: till

Without a captcha, spam bots would post thousands of messages a day. And without manual approval, your site get's listed as useful target on the "marketing" lists of SEO agencies and their "human bots" start to fill the comments with spam.

By: djf

Good article - thanks.

Another tip if you make an alias for a system command - e.g. alias ping='ping c3' - because you use ping so often you do not want pings to be infinite.

Then If you want the system ping (infinite) back for a one time situation you can escape your ping with a backspace - $ \ping - and you will be using the system ping and not your alias ;-)

By: Jon Haugsand

I have the following alias I use quite a lot:alias e='env | grep -Ei'

This is useful to quickly find a shell variable without writing it out. E.g. compare:

echo $JAVA_HOME

with

e java

It is also useful if you know part of the value, but don't remember the name of the variable. E.g. you know there is a proxy setup in the shell, but don't remember the variable names. Just write:

e prox

http_proxy=http://proxyhost.acme.org:8080

ftp_proxy=http://proxyhost.acme.org:8080

https_proxy=http://proxyhost.acme.org:8080

no_proxy=localhost,127.0.0.1

----Final comment: Why use aliases? Bash functions are way more useful.