Enter your email address:

Delivered by FeedBurner

Alias - create alias for your commands


StumbleUpon Toolbar

Alias is a command that lets you create command aliases, it is very useful when you usually use commands with options.

As an example in my case I use a lot these commands

du -h

and

df -h

In both cases the "-h" option makes the output be in Kbytes or Mbytes instead of bytes, so it is more human redeable.

To create aliases for this commands just need to enter.

alias du='du -h'

and

alias df='df -h'

Now both du and df will be executed with its -h option.

If you need to de-alias the command just enter:

unalias du

And the alias for du will be deleted.

To view a list of all aliases just type alias with no arguments on the command line.

Trackback URL for this post:

http://www.go2linux.org/trackback/513
StumbleUpon Toolbar

 If you like this article, subscribe to our full rss

If this article was somehow useful for you, you can leave something in the tip's jar

Please post your question in our forum and use comments only to leave your comments about the article, thanks.

And if you want to make the

And if you want to make the aliases permanent, save it to the ~/.basrc file.

It is .bashrc not basrc.

It is .bashrc not basrc.

If you use zsh, write this

If you use zsh, write this in .zshrc. Very usefull command.

i enter the alises but when

i enter the alises but when it is loading i see following like errors :

- bash alias cp:not found
how can i remove the error
thanks

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

This site is proudly hosted at Bluefur Hosting