I've just installed CentOS7 as a virtual machine on my mac (osx10.9.3 + virtualbox) Running ifconfig returns command not found. Also running sudo /sbin/config returns commmand not found. This is echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/robbert/.local/bin:/home/robbert/bin
Is my path normal? If not, how can I change it?
Also, I don't have an internet connection on virtual machine yet, maybe that's a factor.
Please bear in mind i'm a student and very new to certain terminology.
In some cases. Installing net-tools is not enough directly.
Try this:
apt install net-tools
nano ~/.bashrc
Add this to your bashrc file.
alias ifconfig='/sbin/ifconfig'
Save the file.
source ~/.bashrc
ifconfig
ifconfig
exists in the net-tools
package which may not be installed by default;
sudo yum install net-tools
When the package is installed, it will exist as /sbin/ifconfig
.
I too had same problem after installation of RHEL,CentOS. Resolved with the following. Type:
vi ~/.bashrc
Press i key to go to insert mode. Write the following to the end of this file
export PATH=$PATH:/sbin
then exit Vi by press :wq!
At the terminal type below command to reflect our changes.
source ~/.bashrc
Now type the command ifconfig , it should work.
The ifconfig
command has been deprecated so it is not installed by default on many new distros. The replacement is
ip address
You can write a shortcut
ip a
Very handy :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With