LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-21-2004, 01:23 PM   #1
LinuxRam
Member
 
Registered: Jul 2004
Distribution: Red Hat 9, Mandrake 9.2
Posts: 211

Rep: Reputation: 30
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 ???
 
Old 08-21-2004, 01:25 PM   #2
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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

Last edited by b0uncer; 08-21-2004 at 01:27 PM.
 
Old 08-21-2004, 03:07 PM   #3
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
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.
 
Old 08-28-2004, 10:13 PM   #4
LinuxRam
Member
 
Registered: Jul 2004
Distribution: Red Hat 9, Mandrake 9.2
Posts: 211

Original Poster
Rep: Reputation: 30
thanks b0uncer and mikshaw.
 
Old 08-28-2004, 11:47 PM   #5
dah'dee
LQ Newbie
 
Registered: Jul 2004
Posts: 14

Rep: Reputation: 0
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.
 
Old 08-29-2004, 02:48 AM   #6
realjustin
Member
 
Registered: Aug 2004
Location: /dev/null
Distribution: Slack 10, Debian
Posts: 99

Rep: Reputation: 15
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.
 
Old 08-29-2004, 12:45 PM   #7
LinuxRam
Member
 
Registered: Jul 2004
Distribution: Red Hat 9, Mandrake 9.2
Posts: 211

Original Poster
Rep: Reputation: 30
Thanks realjustin and dah'dee
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where are routes stored? vusa Linux - Networking 4 04-28-2005 06:50 PM
Where mails get stored imahen Red Hat 2 02-06-2005 10:08 AM
Where are executables stored ??? SelaAragon Linux - Software 10 03-15-2004 02:38 PM
Where are screensavers stored? shassouneh Linux - General 9 09-10-2002 03:31 AM
where are the rpms stored chens_83 Linux - Newbie 5 01-03-2002 02:37 AM


All times are GMT -5. The time now is 10:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration