Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-14-2011, 05:02 AM   #1
LQ Newbie
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
Smile /usr/sbin

Hi Guys,

I am new to this forum so please forgive me if you find me wrong.

I am trying to create a new user in my system.

However when i try to run cmd useradd it throws an error "command not found"
When I run /usr/sbin/useradd it is working.

Could you please help me with the reason behind this.

Is it normal system behavior or there is some problem with the system variables.

Please help .

Old 08-14-2011, 05:07 AM   #2
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390

Are you trying to execute this command as root user or as a normal user?

It should be executed by the root user.

Hope this helps.
Old 08-14-2011, 05:08 AM   #3
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello bhavinder, welcome to LQ,

which distribution are you using?

If /usr/sbin/... is found belongs to the path, on Slackware for example the /.../sbin/ pathes are only available for root (by default).

You may execute the command
env | grep -i path
to understand how the pathes are configured on your system. You can es well use this command as root and as a normal user and see what's the difference.

Old 08-14-2011, 05:10 AM   #4
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Hi and welcome to LQ!
/usr/sbin is not in the path of ordinary users. So if you type just useradd, and your not logged in as root then your system won't find anything in sbin. This behaviour is entirely normal and also sensible. programs found in sbin are those which should be run by a system administrator. This is part of Linux security.
Old 08-14-2011, 07:06 AM   #5
Registered: Mar 2006
Distribution: Funtoo
Posts: 124

Rep: Reputation: 25
A quick check:
echo $PATH
shows where commands are searched when you run them as user, while
sudo echo $PATH
shows where they are looked for when run with sudo.
Old 08-14-2011, 11:23 AM   #6
LQ Newbie
Registered: Aug 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks a lot guys....

I never thought that I would get such a warm welcome and quick response to my query.

Thanks again.....

Will check all the suggestions


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
/usr/sbin/httpd: symbol lookup error: /usr/sbin/httpd: undefined symbol: apr_atomic_x dasoberdick Slackware 16 10-11-2014 03:36 AM
What is difference between /usr/sbin/ps & /usr/ucb/ps command rajaniyer123 Solaris / OpenSolaris 6 07-05-2007 01:53 PM
making files available in /usr/local/bin and /usr/sbin reakinator Linux - Newbie 1 10-14-2006 06:09 PM
/usr/sbin and /sbin world read/executable... why? lazlow69 Slackware 3 04-29-2004 06:06 PM
As root, not seeing /sbin and /usr/sbin in path weghman Linux - Newbie 3 04-25-2004 02:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:28 AM.

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