Wednesday, May 9, 2012

command aliasing

command aliasing is used to simplify some frequently used commands. the configuration can be located on .bashrc, /etc/profile, .profile depending on your distribution.

some frequently used commands are ls, mkdir, rm, and grep. ls is file listing program. with a simple touch of aliasing it can be more fascinating than a merely ls.

here are some frequently used aliases.
to see all files including hidden ones (ls with -a option) with la
#alias la='ls -a'

to see files with colorful text (ls with --color=auto) with just ls
#alias ls='ls --color=auto'

not to see error when creating a folder. it will create the parent folder (if not existing) or suppress error when that folder is already existing.
#alias md='mkdir -p'

to prevent accidentally removal of files
#alias rm='rm -I'

No comments:

Post a Comment