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?

Unix/Linux/Mac OS X support by phone, email or on-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





The idea of "work, then get paid" has been deeply ingrained in our culture by employers who want to limit their risk. Well, I like to limit my risks also. I like to get paid before I do work. (Tony Lawrence)

UNIX is simple. It just takes a genius to understand its simplicity. (Dennis Ritchie)







This post tagged: