This site is moved to other domain!

You should be automatically redirected in 9 seconds. If not, visit
and update your bookmarks.

Saturday, January 10, 2009

Stumble Upon Toolbar
written by: Ukion in
[] [] [] []

Linux tip: Use alias command to set shortcut for long Linux commands

Don't want to miss a single bit? Subscribe to our RSS Feed!

The alias command is useful for setting up shortcuts for long commands, or even more clever things. For example, to make short command from DetectorPro post: How to find only today files in Linux, we could make a new command, lsnew, by doing this:

alias lsnew=" ls -al --time-style=+%D | grep `date +%D` "
But there are other uses of alias. For example, common mistyping mistakes. How many times have you accidentally left out the space when changing to the parent directory? Worry no more!
alias cd..="cd .."
Alternatively, how about rewriting some existing commands?
alias ls="ls -al"
saves a few keypresses if, like us, you always want the complete list.

To have these shortcuts enabled for every session, just add the alias commands to your user .bashrc file in your home directory.

Subscribe to DetectorProDid you enjoy this post? Why not leave a comment below and continue the conversation, or Subscribe to Feed and get articles like this delivered automatically to your Email or feed reader.

Related articles by tags