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 ;-)

Share this post with your network :These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Login