Tech Trivia #1: Linux Command Aliases

Posted: April 12, 2009 in OS, trivia
Tags: , ,

1. Typing long commands: If you are repeatedly typing long commands, may be with a lot of parameters, then you should seriously consider using an “alias”. You can create an alias by adding alias newalias=’mycommand –option1 –option 2 –option3 –option4′ to the .bashrc (in /etc/ ).

eg:- alias l1=’ls -l -a’

Now if you type inn l1 it will execute the command.If u want to use more parameters u can use it with the alias as well.For example ‘l1 -p’ wil be treated as ‘ls -l -a -p’. View a sample bashrc.

PS: This does not apply to cshtcsh, and other shells not related to or descended from the classic Bourne shell (sh).

  1. […] functions and aliases for Bash.Changes made will be affecting all the […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s