Solved

getting the message bash: lsmod: command not found

Posted on 2012-04-04
10
712 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 250 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
 
LVL 37

Assisted Solution

by:Gerwin Jansen
Gerwin Jansen earned 250 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now