LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-17-2007, 04:55 PM   #1
wyntre5150
LQ Newbie
 
Registered: Aug 2007
Location: Chicago, IL
Distribution: RHEL 5
Posts: 8

Rep: Reputation: 0
Why don't certain commands work outside of dir?


I have just recently installed RHEL 5. I am in the process of updating my system, when I ran into a fairly weird situation. Many commands weren't working.

The following is just one example, but it works for most commands.

I could enter something like "man useradd" and the manual would come up. I could also use "locate useradd" and it would give me /usr/sbin/useradd. The problem is that when I actually type "useradd" I get "bash: useradd: command not found."

But if I go to /usr/sbin/ and type "./useradd" the command works fine.

What is the problem?
 
Old 08-17-2007, 05:18 PM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Does "echo $PATH | grep '/usr/sbin'" produce any output? If root, maybe your path got screwed up somehow. If unprivileged user, it wouldn't generally be on your path, anyway.
 
Old 08-17-2007, 06:00 PM   #3
wyntre5150
LQ Newbie
 
Registered: Aug 2007
Location: Chicago, IL
Distribution: RHEL 5
Posts: 8

Original Poster
Rep: Reputation: 0
Awesome!!

i entered "PATH=/usr/sbin:$PATH" as root and now they work.

Thank you.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
dir and ll commands runnerpaul Linux - Newbie 5 03-30-2007 02:29 AM
Script works in work dir but nowhere else Drutten Programming 7 10-01-2006 10:22 AM
Firefox calendar won't work, no components dir slackwarefan Linux - Software 0 02-14-2006 11:34 PM
Why do commands work sometimes, but not others? pdmackenzie Linux - Newbie 5 10-31-2004 06:05 AM
problem using ls and dir commands in wu-ftp server amit666 Linux - Newbie 2 02-03-2004 08:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:57 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