LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 09-17-2012, 09:18 AM   #1
suraj_thadarai
LQ Newbie
 
Registered: Aug 2012
Location: India
Distribution: Red Hat Linux
Posts: 6

Rep: Reputation: Disabled
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
ACTUAL COMMAND
PATH=/sbin enter
export PATH enter

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

THESE TWO VARITIES OF COMMANDS ARE NOT WORKING

Last edited by suraj_thadarai; 09-17-2012 at 12:33 PM. Reason: It does gave the sense that why route command was not working on my system
 
Old 09-17-2012, 09:51 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
"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
user.

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:
/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/share/bin

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
 
1 members found this post helpful.
Old 09-17-2012, 09:54 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,187

Rep: Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507Reputation: 2507
Quote:

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
Code:
su -
echo $PATH
it is there
but you need to BE root and using ROOT's path

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

Last edited by John VV; 09-17-2012 at 10:07 PM.
 
Old 09-18-2012, 03:50 PM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,986
Blog Entries: 14

Rep: Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187Reputation: 1187
Suraj,

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH working locally but not remotely on Red Hat Enterprise Linux macd909 Red Hat 7 01-08-2012 08:00 PM
[SOLVED] mouse right click not working in red hat enterprise linux piyusharora420 Linux - General 7 01-07-2011 12:47 AM
Mouse not working in Red HAT LINUX Enterprise 5 divyshorey Linux - Laptop and Netbook 1 04-26-2010 10:51 PM
Commands not working in Red Hat Linux Enterprise 5 anis_huq Linux - Newbie 3 08-18-2009 11:33 PM
Login Screen not working. Red Hat Enterprise Linux 3 WS Dan37290 Linux - Enterprise 0 11-03-2006 04:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration