LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Where is command stored ?? (https://www.linuxquestions.org/questions/linux-general-1/where-is-command-stored-220608/)

LinuxRam 08-21-2004 01:23 PM

Where is command stored ??
 
suppose if i would like to know where is "exit" command stored then how can we know it. ??

not only "exit" command but any command say where is "ls" command stored , it is stored in which file.

Is there is any command for it ???

b0uncer 08-21-2004 01:25 PM

are you searching fore these?

whereis
apropos

try them out, like

whereis ls
apropos whereis

they tell you where and what something is...and oh, with apropos you don't have to use complete names, just a part of a name is sufficient - apropos tries to search things that include the string you gave to it :)

mikshaw 08-21-2004 03:07 PM

other options are "which" and "type -p".
These applications work by searching directories listed in the environmental variable named $PATH

As long as the application is in one of these directories (you will know if you can start the program with just the name without a directory path), you should have no trouble finding it.

The type command is particularly useful in that you can use certain flags to determine what kind of file it is, such as whether a command is an actual program or if it is merely an alias or function.

LinuxRam 08-28-2004 10:13 PM

thanks b0uncer and mikshaw.

dah'dee 08-28-2004 11:47 PM

If your system is running slocate (and it probably is) try the command
locate ls
or whatever it is you want to find.

slocate runs daily and creates a database of all the files on your system.

realjustin 08-29-2004 02:48 AM

You can also try
type X
where X is the command you're intested in. And once you find it you can do
file X
and it will show what type of file it is, an ELF executable, a shell script, etc.

LinuxRam 08-29-2004 12:45 PM

Thanks realjustin and dah'dee


All times are GMT -5. The time now is 09:33 AM.