Operating Systems > Linux and UNIX

commands

(1/2) > >>

Master of Reality:
i am finally pissed off with putting /sbin/(command)
What do i need to do in order to "auto" add /sbin in front of my commands??

iancom:
Assumptions:

-You're using bash
-You need /sbin in the path of an ordinary user (ie not root - this would already be in root's path)

Naturally, you shouldn't add any of the sbin directories to global users' paths since the whole idea is that normal users won't accidentally run admin commands (even if they don't have the rights to do system-wide damage, they may screw up their own profile, get confused  etc).

So, to add it only to your own non-root path, login as that user (or su -) and

vi ~/.bash_profile

after

PATH=$PATH:$HOME/bin

add

:/sbin:/usr/sbin

and then log out and back in again... you should be able to run sbin commands without the full path.

Hope that helps!

Ian

Master of Reality:
it isnt already part of roots path, but i did vi ~/.bash_profile from root and edited it to have that path.
But it still didnt work

[ April 29, 2002: Message edited by: Master of Reality ]

[ April 29, 2002: Message edited by: Master of Reality ]

iancom:
Very odd... but then I mostly use RedHat - maybe other distros don't default to including the sbin's in root's path?

Master of Reality:

quote:Originally posted by IanC:
Very odd... but then I mostly use RedHat - maybe other distros don't default to including the sbin's in root's path?
--- End quote ---

i am using red hat 7.2 but i usually find out some way to make it more difficult to myself whenever trying a new OS.

Navigation

[0] Message Index

[#] Next page

Go to full version