Add

Wednesday 22 June 2016

Aliases - First thing to setup in Linux

Aliases are best made tools for making your life simpler in Linux.

You can set it temporarily ( session based )  or Permanent( edit /etc/bashrc ) or User specific( edit ~/.bashrc )

It reduces the typing effort of commands or groups of commands that are long and/or tedious to type.

Commands :  
# alias  name=' very big command with arg1 arg2...' 
# alias  name='script.sh' 

# alias dir="ls -al | grep ^d" 
# alias p="pwd"; l="ls -al"  

aliases can be used to increase the safety of the system by making commands interactive.

# alias rm="rm -i" 
# alias cp="cp -i"   

You can create your own user friendly commands


# alias dir="ls -al | grep ^d"  

Removing Aliases

unalias rm  
unalias cp   

No comments:

Post a Comment