PDA

View Full Version : Certain programs such as ifconfig ?



krazyshane
5th April 2006, 02:19 AM
I frequently use the ifconfig command in linux. Usually, thats all it takes from a konsole. Depending on the dist, you have to be su or dont, but 'ifconfig' always works.

However, with fedora it seems that ifconfig is installed to the sbin directory instead of just the bin? Is this correct?

I found out that you must type /sbin/ifconfig, but I find that to be an annoyance. Why is this?

Also, I sometimes delete folders from within konsole, and i've always used the

#rm -r command. This usually works no problem, but fedora now asks me to step into each and every folder. why is that? Sorry for the somewhat random questions, just things popping into my head. I am very happy w/ fedora. It was a clean install and runs very well... just not have to figure out why things are the way they are and get it working the way i'm happy with :)

Thanks in advance,
Shane

Christy
5th April 2006, 02:23 AM
Have never tried rm -r, but rm -rf has always worked for me in FC3 and 4...haven't had time to mess around in 5 yet (yay to school work for taking up my linux time :p !), but it should work too. As for ifconfig, again, haven't tried it in 5, but it worked in 4 for me.....

taurus
5th April 2006, 02:25 AM
If you want to run programs in /sbin, then why don't you just add it to your PATH in ~/.bashrc... Click Applications -? Accessories -> Terminal. Then open an editor with


gedit ~/.bashrc

Now, move all the way to the bottom of that file and add these two lines...


PATH=$PATH:/sbin
export PATH

Save it and run this at the prompt (or log out and back in again).


source ~/.bashrc

Now, you just have to type "ifconfig" from a prompt to run it. No need to include /sbin in front anymore!

krazyshane
5th April 2006, 02:51 AM
Hey thanks Taurus! I am still pretty new to linux, but my career and a lot of my hobbies revolve around computers so I should catch on. It's nice to learn things like this. I dont quite understand path variables. I assume that this one however just means that it looks in /sbin as well as /bin for program automagically :)

Oh, and Christy.. This is my first fedora experience (and gnome too!), but I've got to say it's great. Everything is quick, responsive and pretty. Works well. You should def. install it when you get some time.

Thanks again
Shane

Christy
5th April 2006, 03:44 AM
Hey thanks Taurus! I am still pretty new to linux, but my career and a lot of my hobbies revolve around computers so I should catch on. It's nice to learn things like this. I dont quite understand path variables. I assume that this one however just means that it looks in /sbin as well as /bin for program automagically :)

Oh, and Christy.. This is my first fedora experience (and gnome too!), but I've got to say it's great. Everything is quick, responsive and pretty. Works well. You should def. install it when you get some time.

Thanks again
Shane

It's installed, I have had it since just after FC3 came out (am currently running 5). Just haven't messed around much in 5 because of school work. So I know a bunch of stuff works in 4, and *should technically* work in 5. :) From what I have seen of 5 in the couple hours I've actually been able to commit to it, it's great.

bweekes
5th April 2006, 05:32 AM
#rm -r command. This usually works no problem, but fedora now asks me to step into each and every folder. why is that?

By default in FC, the rm command is aliased to enable the interactive mode which is used to help prevent deleting files or directories by mistake. As was noted earlier, the -f argument can be used to force rm to delete the files and bypass the interactive mode. These arguments are common on many flavors of UNIX and you can obtain more information by doing a
man rm
within a terminal to view the man pages.

bweekes
5th April 2006, 05:35 AM
To see what your aliases are set to, just type
alias
within a terminal. NOTE: The aliase settings are dependant on the user you are logged in as. You may see different alias settings as root than you would logged in under your own account.

jhetrick62
5th April 2006, 05:42 AM
Or when entering root mode to execute a command, use the "su -" command and you will get the root users path.

Jeff

krazyshane
5th April 2006, 06:34 AM
Hey, thanks everyone for the tips. All very handy.

Shane

ItsTheSource
5th April 2006, 06:36 AM
does anyone know the reason why fedora chooses not to include /sbin and /usr/sbin in the bash profile?

bweekes
6th April 2006, 02:47 AM
The files in the sbin directories are usually utilities utilized by root only or for tasks that should be done as root only. Once you do a su to root in a terminal:
su -
the sbin directories are in your PATH.

Omega Blue
6th April 2006, 05:58 AM
If you "su -" you'll get all the commands at your disposal.

krazyshane
6th April 2006, 03:15 PM
Why is it that the '-' is required to gain access to the root paths? In the past, I have always just accessed the root acount by typing "su" alone, which works in fedora -- without the paths.

Shane

gandalf2041
6th April 2006, 04:44 PM
The "-" tells the shell to change environments (i.e. source root's path and other variables). "su" by itself will give you root privileges but it won't change the environment (so you'll still be searching YOUR path)