LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-11-2004, 11:41 PM   #1
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Rep: Reputation: 15
'whereis' finds a command but I can't execute it


Hey folks!

What's wrong when whereis finds a command but when I try to execute it, I got the 'command not found' message?

Code:
[bcampos@localhost modules]$ whereis depmod
depmod: /sbin/depmod /usr/share/man/man8/depmod.8.gz
[bcampos@localhost modules]$ depmod
bash: depmod: command not found

Tks.

Last edited by brunnopessoa; 10-12-2004 at 12:08 AM.
 
Old 10-11-2004, 11:59 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You need to login as root for /sbin ....
 
Old 10-12-2004, 12:05 AM   #3
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Ooops... I got the same problem when logged on as root:

Code:
[root@localhost modules]# whereis depmod
depmod: /sbin/depmod /usr/share/man/man8/depmod.8.gz
[root@localhost modules]# depmod
bash: depmod: command not found

Last edited by brunnopessoa; 10-12-2004 at 12:08 AM.
 
Old 10-12-2004, 12:06 AM   #4
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
Just to add:

You can execute the command by giving it's fully qualifed name if you have the permission to run it. For example, ifconfig for read only purposes:
Code:
/sbin/ifconfig
 
Old 10-12-2004, 12:08 AM   #5
mirradric
Member
 
Registered: May 2004
Location: Singapore
Distribution: Debian woody and debian sarge
Posts: 188

Rep: Reputation: 31
Quote:
Originally posted by brunnopessoa
Ooops... I got the same problem when logged on as root:

[root@localhost modules]# whereis depmod
depmod: /sbin/depmod /usr/share/man/man8/depmod.8.gz
[root@localhost modules]# depmod
bash: depmod: command not found


I think I've seen this discussed somewhere on LQ about fedora not adding /sbin to the of root. You can always use the absolute pathname or add /sbin to your path.
 
Old 10-12-2004, 12:11 AM   #6
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by mirradric
I think I've seen this discussed somewhere on LQ about fedora not adding /sbin to the of root. You can always use the absolute pathname or add /sbin to your path.
You're right! /sbin is not in the path!
Tks everybody! Got it!
 
Old 10-17-2004, 03:29 PM   #7
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
... I thought the 'whereis' command only shows the location of a program when it is in the PATH, no?

tks
 
Old 10-17-2004, 06:55 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Just bear in mind that the tool that does
the whereis-lookup may have a different
PATH from root, too :}

Code:
From "man whereis"
       whereis has a hard-coded path, so may not always find what
       you're looking for.


Cheers,
Tink
 
Old 10-17-2004, 07:13 PM   #9
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
when you do just 'su' the paths for root don't get loaded. if you want the paths for root to be loaded use 'su -'.
 
Old 10-18-2004, 01:05 AM   #10
brunnopessoa
Member
 
Registered: Nov 2003
Location: Rio de Janeiro, Brazil
Distribution: Fedora
Posts: 67

Original Poster
Rep: Reputation: 15
Got it, megaspaz! Tks a lot!
 
  


Reply



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
remote command execute telnet with 1 command MPowers Linux - Networking 2 06-30-2005 06:31 AM
YUM finds 4 updates while up2date finds 29? guest Linux - Newbie 3 03-15-2005 09:01 PM
command execute without ./ kaon Slackware 11 09-15-2004 05:14 PM
Gaim 0.71: pkg-config finds 2.2.3, ./configure finds 2.2.1 GreenPenInc Linux - Software 3 10-23-2003 08:00 PM
Execute Command lawrencegoodman Linux - Newbie 2 10-23-2003 08:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:27 PM.

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