-   Linux - Newbie (
-   -   Route command is not working on my Red Hat Enterprise Linux 5 (

suraj_thadarai 09-17-2012 10:18 AM

Route command is not working on my Red Hat Enterprise Linux 5
I am using Red Hat Enterprise Linux 5
Bash Shell gives me the message
bash: route: command not found.
I am unable to figure out the problem.
I am using Linux on my virtual machine.

how do i add the /sbin directory to my $PATH environment variable.
plz provide me with the complete command steps.
as i am trying like this
PATH=/sbin enter
export PATH enter

and like this
$PATH=/sbin enter
export $PATH


MensaWater 09-17-2012 10:51 AM

"command not found" means either:

1) The command does not exist.

2) The command exists but is in a directory not included in your PATH variable.
Note: Some commands are in the PATH for the root user but NOT for other users because they're intended to be run as
root user. route is such a command. Your issue may simply be that you are trying to run route as a non-root

So to determine on RHEL5 where the "route" command comes from you can run:

yum provides "*/route"

The command comes from the net-tools package.

If you run "yum list net-tools" you'll see available packages and also if any are already installed.

If the package is not installed you can run "yum install net-tools".

If the package is installed you can run "rpm -ql net-tools |grep /route$" to find the file.

This will show you the command is in /sbin/route.

You then type "echo $PATH" and see if you see the directory "/sbin" in the variable. Note that directories are colon delimited so it should be something along the lines of:

The order in PATH is important. If you had route in both /usr/bin and /sbin it would use the one in /usr/bin because that is the one it will find first.

Also you can find files already on your system by trying to use the locate command or the find command. You can get details of these by typing man for each:
man locate
man find

John VV 09-17-2012 10:54 PM


how do i add the /sbin directory to my $PATH environment variable.
it IS ALREADY in the system $PATH
it is just NOT accessible by NON root users
this is for security reasons
/sbin has NO PROGRAMS that a normal user can use

try this

su -
echo $PATH

it is there
but you need to BE root and using ROOT's path

"route" is NOT in /sbin it is in /usr/sbin
also a folder that has NO programs that a normal use can use

MensaWater 09-18-2012 04:50 PM


You really shouldn't modify your original post AFTER someone has replied.
1) It makes it less likely someone will notice you had an update.
2) It makes it hard to follow the thread in future as the reply doesn't look as if took your original information into account.

All times are GMT -5. The time now is 07:09 PM.