Working with Bash Aliases (Alias/Unalias)

Bash - GNU Shell, Tips View Comments

Aliases allow a string to be substituted for a word when it is used as the first word of a simple command. The shell maintains a list of aliases that may be set and unset with the alias and unalias builtin commands.

Read the rest of this entry »

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

How will be interpreted a command

Bash - GNU Shell, Tips View Comments

You probably have set some personnal alias or function on your box. Most common is probably dir, ls, ll… If you forgot how you define your alias or function, the easiest way for get back the definition isn’t to read your numerous .bashrc but using some bash built-in command : type or command.

type: usage: type [-afptP] name [name ...]

command: usage: command [-pVv] command [arg ...]

Command is generally used for running command with arguments ignoring any shell function named command. Instead of Type that describe a command, for each name, indicate how it would be interpreted if used as a command name. But both can be used, here is some examples :

nicolas@grimm:~$ type dir
dir possède l’alias `ls –color=auto –format=vertical’
nicolas@grimm:~$ command -v ls
alias ls=’ls –color=auto’
nicolas@grimm:~$ command -V ls
ls possède l’alias `ls –color=auto’
nicolas@grimm:~$ command -V dir
dir possède l’alias `ls –color=auto –format=vertical’
nicolas@grimm:~$ command -V rm
rm is /bin/rm

Enjoy ;-)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in