APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Command

This is a safety net. You can use it to make double-dog sure that you are not accidentally invoking some function. For example, suppose we redefine "sort" in bash:


function sort {
echo "Not today"
}
 

After this, trying to sort a file doesn't do much:


 apl$ sort t
 not today
 

But "command sort t" will work.

"command" can also just tell you what would be used:

apl$ command -V sort
sort is a function
sort () 
{ 
    echo "Not today"
}
 

It can also help if you think your PATH might be screwy:

~ apl$ PATH=./bin
~ apl$ sort t
bash: sort: command not found
~ apl$ command -p sort t

abc
abc
abc
def
def
def
foo
geh
geh
geh



Got something to add? Send me email.




Increase ad revenue 50-250% with Ezoic


More Articles by

Find me on Google+

© Tony Lawrence



Kerio Samepage


Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us





You learn about life by the accidents you have, over and over again, and your father is always in your head when that stuff happens. (Kurt Vonnegut)





This post tagged: