Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi I am new to linux i install redhat 9
I use ifconfig command it says command not found but when I use the full path I can able to use ifconfig command, my question is how can I use ifconfig without giving full path also how can I use any command without giving full path is there a way.
iam newbie i recently install suse linux 10.1 when i use su and type /etc/shadow it says permission denied i dont know why.

ifconfig is located in your system's /sbin directory. /sbin is not usually included in the user's PATH environment variable. For this reason, when you attempt to execute ifconfig, bash can not find it. You have several options available to you.
1). You can continue to enter the full path to ifconfig as you do now.
2). su to root, then run ifconfig. Use caution when logged in as root. The root user has a great deal of power. If that power is used carelessly, it can wreak havoc on your Linux system.
3). Create a symbolic link to /sbin/ifconfig in your ~/bin directory or in /usr/bin. Both should be in your user's PATH environment variable. If you put the link in /usr/bin, it will be available to all users on your system. If you put it in ~/bin, it will be available only to your user account. To create a symbolic link to /sbin/ifconfig, open a terminal window. Switch to your ~/bin directory:
cd ~/bin
or to /usr/bin
cd /usr/bin
If you put the link in /usr/bin, you must su to root before creating the link. Create the symbolic link:
ln --symbolic /sbin/ifconfig
4). You can add /sbin to your user's PATH environment variable. To do this, edit .bash_profile in your user's directory. If there is no .bash_profile, then edit .bashrc. There should be a line similar to:
PATH=$PATH:$HOME/bin
Edit the line to read:
PATH=$PATH:$HOME/bin:/sbin
Log out, then back in (no need to reboot). Now your bash command interpreter can locate any program in /sbin, and you can run them provided your user account has permission (authority) to do so.
Ernie Registered Linux User 247790
ICQ 41060744

If you are using "su" to switch to root user you may have to use "su -" to get root's path as well.
Another way would be to use sudo which you can set to inherit root's path, eg "sudo ifconfig".

Thanks guys
i forgot to ask when i try to open /etc/hosts it says permission denied i change permission chmod 777 /etc/shadow but it still says permission denied how can i change permission for root, root has all access then how come it says permission denied.iam newbie i recently install suse linux 10.1 when i use su and type /etc/shadow it says permission denied i dont know why.

as root user /etc/hosts
do i need to use allow or denied with host file??
iam newbie i recently install suse linux 10.1 when i use su and type /etc/shadow it says permission denied i dont know why.

For info on the /etc/hosts file type:
man hostsIt sounds like you are trying to run text files and not binaries....what program are you using to edit /etc/hosts and /etc/shadow?

![]() |
postfix problems
|
redhat 9.0 over xp
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |