LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-13-2007, 09:37 PM   #1
greengrocer
Member
 
Registered: Aug 2005
Distribution: Ubuntu Intrepid and Meerkat, formerly used Debian 3.1 (Sarge) with Gnome Desktop
Posts: 353

Rep: Reputation: 37
How to ensure paths are set during boot


Hello all,

Using Fedora Core 6 at present, but I suppose the answer to this question will apply to many distros.

How does one configure 'paths' so that the desired 'paths' are configured during the boot process?

For instance, when I am root, I always have to type '/sbin/ifconfig' which is annoying. I would like to just type 'ifconfig'

So how do I set /sbin as a default 'path' for linux to look into for the commands I type, during boot up?

Regards,
greenie
 
Old 04-13-2007, 10:19 PM   #2
greengrocer
Member
 
Registered: Aug 2005
Distribution: Ubuntu Intrepid and Meerkat, formerly used Debian 3.1 (Sarge) with Gnome Desktop
Posts: 353

Original Poster
Rep: Reputation: 37
I edited /etc/profile and added "pathmunge /sbin", so the end of the /etc/profile file looks like this:

Code:
done
 pathmunge /sbin
unset i
unset pathmunge
It solved my immediate frustration, but I am wondering if this is good practice?

Regards,
Greenie
 
Old 04-13-2007, 11:41 PM   #3
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian jessie/sid; OpenSuSE; Fedora
Posts: 1,593

Rep: Reputation: 162Reputation: 162
With a few exceptions all the commands in /sbin must be run as root. Ifconfig happens to have one function that can be run as user: Ifconfig with no parameters gives interface info. If there is a program you want to run as user, but it isn't in the user's PATH you do this:


#!/bin/bash
#ifconfig file for normal users
/sbin/ifconfig
end

in a text editor. Make it exectutable:

chmod a+x <filenameofscript>

and then, from whatever directory the file is in:

./filenameofscript

will run /sbin/ifconfig.
 
Old 04-14-2007, 12:47 AM   #4
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
The easiest is to add the following line to /root/.bashrc or /root/.profile.

PATH=$PATH:/sbin

If you use su - to substitute user for root, then you will not be in this problem. Both Redhat and Fedora have the same issue.
 
  


Reply


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
can't boot linux knoppix from cd - setting paths errors mam1 Linux - Newbie 6 12-01-2006 05:14 AM
how do you alter/ add to paths set on startup? PaleViper Linux - Newbie 4 10-08-2004 01:55 PM
How do you set up links or paths in LINUX? Mandrake 9.2 Java VM Ygarl Linux - Newbie 4 03-29-2004 03:00 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM
how to ensure only one record exist with the same name. meluser Programming 5 03-18-2003 02:12 PM


All times are GMT -5. The time now is 04:00 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration