?
Solved

getting the message bash: lsmod: command not found

Posted on 2012-04-04
10
Medium Priority
?
890 Views
Last Modified: 2012-04-05
hi ,

i am working on RhEL server and almost every command i type i get
bash : command not found

i did

# bash
return

tried and nothing

i did

# PATH = /sbin/bash

nothing

any ideas ?
0
Comment
Question by:c_hockland
10 Comments
 

Author Comment

by:c_hockland
ID: 37808527
i am sorry , i menat

SHELL=/usr/bin/bash

and no luck
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 1000 total points
ID: 37808544
The PATH variable setting is not correct. Did you try to logout / login again. Try to source ~/.profile or ~/.bash_profile with command

. ~/.profile

or

. ~/.bash_profile

Please note the dot and space in the above commands

Then see what you get when you run

echo $PATH
0
 
LVL 6

Expert Comment

by:Patrick Tallarico
ID: 37808553
Check this out and see what you PATH environment variable is looking at.
http://www.troubleshooters.com/linux/prepostpath.htm
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 38

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 1000 total points
ID: 37808613
Try setting your path like this:

PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
export PATH

Then try one of your commands.
0
 

Author Comment

by:c_hockland
ID: 37808724
i did and i got he following

[h80613@ussef301 proc]$ ~/.bash_profile
bash: /home/h80613/.bash_profile: Permission denied


do i need to be added to sudo group ?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 37808735
did you try to source the .bash_profile as shown above?
0
 

Author Comment

by:c_hockland
ID: 37808774
v
[h80613@ussef301 proc]$ pATH=/usr/local/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
[h80613@ussef301 proc]$ export pATH
[h80613@ussef301 proc]$ lsmod
bash: lsmod: command not found
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 37808776
please note that you have a typo in pATH it should be PATH
0
 

Author Comment

by:c_hockland
ID: 37808781
yes , u r right . I typed it correclty and it worked.
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 37808799
you may add the commands to ~/.profile or ~/.bash_profile
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question