Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello all,
I am using VMWare Workstation 7 and have installed a NEW COPY of RHEL Enterprise Edition 6.0 in it.
After i enter the bash shell as the SuperUser, and type the command:
echo $PATH and then press Enter
I am only able to see the following paths, namely:
1. /usr/kerberos/sbin; 2. /usr/kerberos/bin; 3. /usr/local/bin; 4. /usr/bin; 5. /bin; 6. /usr/X11R6/bin; 7. /home/user/bin
However, ideally there should be, in addition to the above, paths like: 8. /sbin; 9. /usr/sbin; 10. /home/user/sbin.
This problem seems to occur intermittently, so here are a few things that occur to me:
a. Since this is a fresh copy, and i haven't removed anything yet, i assume either its a problem with VMWare or my RHEL installation is corrupted?
b. Else as suggested by a friend, i may be able to use the export command to add the above paths. Incase this is possible, can someone also provide me with the syntax as to how the export command can be used for this scenario?
c. If there is any other scenario, i am overlooking with regards to this, please let me know?
$10 says you are becoming root by running "su". This does not create a full root environment (SuperUser? What's that...??). either run "sudo -i" or "su -" to get a proper root login shell.
How on earth this could possibly be a VMware is way way beyond me!
Using the 'su -' does provide an additional set of paths once i execute the echo command. As you mentioned, i overlooked the differences of 'su' and 'su -'.
I have another question regarding whether the 'export' command can be used to define additional paths as i had mentioned before?
Grateful to anyone who can provide me a syntax for the same..
you can use export yes, but not in the way I expect you think it will work. You would generally add those commands to your ~/.bash_profile but be careful what you add, generally you really wouldn't need to change it, and if you think you do, you're doing it wrong. for example, your current directory should never be on your path. Other times sure you do need to. The script here, or system wide at /etc/profile, are where those paths are set, so you can see the current export commands in them directly.
I don't think anything **here** would prefer "SuperUser" over "root"
Last edited by acid_kewpie; 05-08-2012 at 09:25 AM.
I think you are in for a lot of reading, and a lot of fun.
The earlier comments apply, I have no argument with anything said so far.
I do want to add one thing: $PATH is an environment variable, not a function or utility. The difference may be critical.
It does not accumulate: ie a second assignment REPLACES the first.
There are some script and program utilities that allow you to pass a parameter, and (assuming it is a folder) they will check the current PATH and optionally add or remove it from the path as needed. (Testing to ensure that no path is added twice, etc.)
I know of no one who uses them extensively for anything other than startup scripts and automation. (pathmung come to mind)
An effect something LIKE those functions is easy to provide using a technique like this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.