How will be interpreted a command

Bash - GNU Shell, Tips Add 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)
blog comments powered by Disqus
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in