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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
my ifconfig is broken. and i dont know how to fix it.
I go into /sbin and i see the file but when i try and execute the command is says bash: ifconfig: command not found.
The permissions on the file are as follows
-rwxr-xr-x 1 root root 71528 May 25 2008 ifconfig
i am still new to Linux and i don't know how to fix this. any suggestions on how to fix it would be great.
Exactly how are you trying to execute "ifconfig"? It's probably a path problem, as "/sbin" isn't really supposed to be in your normal userid's path. Try typing this "sudo /sbin/ifconfig". If you don't have "sudo", then you need to become root and execute "/sbin/ifconfig".
This is my users $PATH
this is my Root $path
if i do a /sbin/ifconfig it does work.
so I can tell this is entirely a path issue.
As per the first reply i tried to edit the file they listed to add /sbin to the path but the file at the location /etc/profile.d/env.sh does not exist. what file do i need to edit to add the /sbin to my user accounts?
You should really not add /sbin to your user accounts.
Generally, I agree, and it doesn't take much to just simply type /sbin/ifconfig if you need it. But, if you really want to add it to the path (and assuming you use bash, which it the standard for CentOS I think), you just add:
to your ~/.bashrc file. If you don't have one, just create it. Mine looks like:
# Source global definitions
if [ -f /etc/bashrc ]; then
# User specific aliases and functions
the reason i am wanting to add it to a specific to user is because I am getting e-mail notification from a cron job that is saying the ifconfig command is not found. the cron job is coming specifically from a file called collectinfo.pl. so i am trying to figure out how to get this to stop because the cron job runs every 5 min. and every time it failes i am getting a e-mail saying that the cron job had errors.
Simple, fix the cron job and have it execute "/sbin/ifconfig" rather than just "ifconfig". Generally, any script executing a program should use the whole path, not just the program's name. That should be one of the first thing a script-writer learns.
the cron job is not actually running the ifconfig command it is running a command for a file called collectinfo.pl. I believe that the collectinfo.pl in its processing is running the ifonfig command. and if there is a way to edit that .pl file I would prefer that. but i dont know if that possible.