LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-13-2005, 10:46 PM   #1
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Rep: Reputation: 30
locate a commnad


I have run updatedb

then I type locate "mount"

it gives me a list of everypath with mount in it. Is there a way to find just the command mount without all the extra junk?


Zakk
 
Old 04-13-2005, 10:52 PM   #2
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,534

Rep: Reputation: 100Reputation: 100
whereis
 
Old 04-13-2005, 11:02 PM   #3
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Original Poster
Rep: Reputation: 30
Couple of questions about that.
1. Do you need to run a command like updatedb first?
2. It also seems to spit out more than one output. Are these depenancies or something?

I'm checking out the man page right now.
 
Old 04-13-2005, 11:08 PM   #4
JLTB
Member
 
Registered: Aug 2004
Location: Langley, BC, Canada
Distribution: Debian, SUSE {9.1, 9.2-64, 9.3-64}, Ubuntu
Posts: 80

Rep: Reputation: 15
Hey zchoyt,

Here's what I do,

run 'updatedb' (you did that) then use locate but pipe the output to less, or better yet
'grep' it first. Grep is the super geeky unix program that lets you search for patterns within strings (ok, maybe its not that geeky). It will allow you to filter the output a bit. 'less' is a program that displays output in such a way that you can scroll up and down through it to read it all (kinda like a really simple readonly text editor).

something like 'locate mount|grep bin|less' will look for everything on your computer with mount in it, then only display the results that ALSO had 'bin' in them, then display it all in less so you can read it before it whizzes past your eyes.

There are some good tutorials around as well, try something like 'grep tutorial' or 'locate tutorial' in Google.
 
Old 04-13-2005, 11:18 PM   #5
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Original Poster
Rep: Reputation: 30
Cool, thankx for the tips. I am getting used to linux env still. I did know about those commands but didn't think about using them together like that. It worked pretty well.
 
Old 04-14-2005, 05:56 AM   #6
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
you should check out linux's commands as it makes life a hole lot easier

http://www.linuxcommand.org/
 
Old 04-14-2005, 06:12 AM   #7
rpz
Member
 
Registered: Mar 2005
Posts: 126

Rep: Reputation: 15
locate bin/mount will also work. grep is not needed. The 'which' command will tell you the program that is actually run with a command, even if it's aliased or whatever. It does not use the locatedb but uses the environment (e.g. PATH).
 
Old 04-14-2005, 02:18 PM   #8
JLTB
Member
 
Registered: Aug 2004
Location: Langley, BC, Canada
Distribution: Debian, SUSE {9.1, 9.2-64, 9.3-64}, Ubuntu
Posts: 80

Rep: Reputation: 15
Good point rpz, that is more efficient.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to locate where a program is? minm Linux - Newbie 18 08-16-2004 02:00 AM
Does Slackware have "lndir" commnad? buboleck Linux - Newbie 2 12-23-2003 12:05 PM
locate juanb Linux - Newbie 2 12-18-2003 05:36 AM
Can't locate locate hindenbergbaby Linux - Newbie 3 10-22-2003 04:13 PM
how to locate ? jamaso Linux - General 4 10-17-2002 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:39 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration