Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-26-2005, 11:09 AM
|
#1
|
LQ Newbie
Registered: Feb 2005
Location: London
Distribution: Auditor
Posts: 25
Rep:
|
Bash: command not found!
Hi
I'm having a very weird problem. whatever command I type I keep getting "bash: ls: command not found". That go for all the command Except for the "pwd" and "echo" no idea why its doing that?
By the way its a "SunOS" I don't have choice in the matter, as its a University Server and I have to use it to do my work.
some example.
[simt /home/ugrad/adh098] ls -l
bash: ls: command not found
[simt /home/ugrad/adh098] ls
bash: ls: command not found
[simt /home/ugrad/adh098] man
bash: man: command not found
[simt /home/ugrad/adh098] man bash
bash: man: command not found
[simt /home/ugrad/adh098] cd
[simt /home/ugrad/adh098] bash
bash: bash: command not found
[simt /home/ugrad/adh098] echo whats going on?
whats going on?
[simt /home/ugrad/adh098] ls -l
bash: ls: command not found
[simt /home/ugrad/adh098] ls
bash: ls: command not found
[simt /home/ugrad/adh098] pwd
/home/ugrad/adh098
[simt /home/ugrad/adh098]
P.S do I need to edit my profile to correct this problem?
Appreicate you help.
|
|
|
10-26-2005, 11:15 AM
|
#2
|
Senior Member
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460
Rep:
|
echo $PATH
|
|
|
10-26-2005, 11:36 AM
|
#3
|
LQ Newbie
Registered: Feb 2005
Location: London
Distribution: Auditor
Posts: 25
Original Poster
Rep:
|
echo $PATH
Return
/bin/ksh/
I have feeling I need to change some setting in the .profile
|
|
|
10-26-2005, 11:47 AM
|
#4
|
Senior Member
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460
Rep:
|
Yep - PATH tells Bash where to look to find the executables like "ls" - usually , they'll be somwehre like /usr/bin
You need to add those directories to your PATH to make them work. In the meantime, use the full pathname to get the functionality: "/usr/bin/ls" instead of just "ls"
|
|
|
10-26-2005, 11:59 AM
|
#5
|
Senior Member
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460
Rep:
|
*EDIT: Duplicate post*
|
|
|
10-27-2005, 06:03 AM
|
#6
|
LQ Newbie
Registered: Feb 2005
Location: London
Distribution: Auditor
Posts: 25
Original Poster
Rep:
|
I Fixed Problem
I now know what caused the problem. My ".profile" only had one line that said.
MAIL=/usr/mail/${LOGNAME:?}
But i've added this line to it.
PATH=/usr/bin/ksh/
and that when the problem started... so I've removed this line and exit it the shell, and logged back in, and everthing was normal.
P.S if I want to have bash by default when I log in what should I add to my ".profile" ?
thanks for you help.
|
|
|
10-27-2005, 06:35 AM
|
#7
|
Senior Member
Registered: Oct 2004
Posts: 1,272
Rep:
|
That is why you had the problems,
your path needs to list all the locations where binary files are found eg: bin;usr/bin;/usr/local/bin. If you want to change your shell then instead of PATH=/usr/bin/ksh you need
And to answer your question - to have bash as your default shell then you need
Code:
SHELL=/usr/bin/bash
though please make sure it exists before setting it, you can do that by typing bash in your current shell and seeing if you get a bash prompt
Last edited by phil.d.g; 10-27-2005 at 06:37 AM.
|
|
|
10-27-2005, 06:38 AM
|
#8
|
LQ Newbie
Registered: Feb 2005
Location: London
Distribution: Auditor
Posts: 25
Original Poster
Rep:
|
Everyday I'm learning new things
thanks for the tip
|
|
|
12-16-2005, 08:25 PM
|
#9
|
LQ Newbie
Registered: Aug 2005
Location: United States
Distribution: Suse 9.1
Posts: 7
Rep:
|
I am trying to install crossover and getting the message bash: $: not found. I am running SUSE 10 Pro. Can someone help?
thanks
|
|
|
12-17-2005, 07:36 AM
|
#10
|
Senior Member
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938
Rep:
|
If you want to add a line to the PATH, do it like:
Code:
PATH=$PATH:/new/path:/another/new/path
etc
The $PATH bit means it includes what the currently set path is. What you put in changed the path, rather than adding to it.
|
|
|
10-09-2008, 10:48 PM
|
#11
|
LQ Newbie
Registered: Oct 2008
Posts: 1
Rep:
|
Can anybody help me with this?
I dnt know if this is an SME problem or with the bash something... I've tried searching help from SME forums but nothing seems to help so I've figured maybe this could be with the bash problem o something...
Anyways here my problem, everytime I type this to the shell
Quote:
expand-template /root/.my.cnf
|
It would then give me an error "bash:expand-template: command not found"...
So the only way for me to get that command to work is this
Quote:
/sbin/e-smith/expand-template /root/.my.cnf
|
even if I just type in "db" in the shell, it give me the same problem "bash:db: command not found"...
Now does anyone of you guys no about on how to resolve this? Like how to change bash to the default... I'm a newbie a linux and SME, so if any of u have any info in helping, cud u also give a step-by-step detail in how to..
|
|
|
12-10-2008, 10:55 AM
|
#12
|
LQ Newbie
Registered: Dec 2008
Posts: 1
Rep:
|
can anybody solve this problem!!
[prashanth@localhost ~]$ xlc_r –q64 –qarch=auto –qmkshrobj Hello.c –o libhello.so
bash: xlc_r: command not found
I am trying to compile native c code using JNI.but not able to do so
|
|
|
07-24-2009, 08:47 AM
|
#13
|
Member
Registered: May 2009
Posts: 281
Rep:
|
This works for me
Where is the ".profile" file? I have added path by the shell, but I would like to know where is the file? Thanks
[QUOTE=Komakino;2003519]If you want to add a line to the PATH, do it like:
Code:
PATH=$PATH:/new/path:/another/new/path
Hi, I had a problem with qt 4 specially for the uic3 convector, was giving me bash error
I added the PATH on the shell and it works. Thanks
|
|
|
03-13-2010, 10:52 AM
|
#14
|
LQ Newbie
Registered: Mar 2007
Location: Boston, MA, US
Distribution: openSUSE 11.2
Posts: 4
Rep:
|
Adding response for completeness...
I noticed there was a dangling question in the last post. So should someone get here, I am adding a bit more detail.
Quote:
Originally Posted by PeterUK
Where is the ".profile" file? I have added path by the shell, but I would like to know where is the file? Thanks
|
Quote:
Originally Posted by Komakino
If you want to add a line to the PATH, do it like:
Code:
PATH=$PATH:/new/path:/another/new/path
|
The bash shell can use several configuration files. There are the default startup/configuration files in /etc (eg /etc/profile). These are intended to provide reasonable default settings. You can tailor your bash shell environment by creating specially named files in your home directory. These are:
~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc When you login, the configuration files are searched for and read in an ordered fashion (/etc/profile -> ~/.bash_profile -> ~/.bash_login -> ~/.profile) In this manner your setting will add to or override the defaults.
When you are starting a bash shell after logging in, the ~/.bashrc file will be read if it exists.
Typically one creates any of ~/.bash_profile, ~/.bash_login, ~/.profile for settings that are needed for all of your bash shells. ~/.bashrc is reserved for setting the environment specifically for your interactive shells. bash reads the login configuration files just once at login. ~/.bashrc is read for each startup of an interactive shell.
The fine details for bash are found in the manual page, bash(1). Type
on your command line.
Bonne chance et bon courage!
--Eric
|
|
1 members found this post helpful.
|
04-09-2012, 02:04 AM
|
#15
|
LQ Newbie
Registered: Sep 2008
Posts: 1
Rep:
|
Bash Error: Command Not Found
Hi you,
The solution is simple. Run the following.
/usr/bin/gedit ~/.bashrc
My file shows following contents:
############ START NS 2.33 ############################
export NS_HOME=/home/maazrehan/NS2/ns-allinone-2.33
export PATH= $PATH:$NS_HOME/bin:$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NS_HOME/otcl-1.13:$NS_HOME/lib
export TCL_LIBRARY=$NS_HOME/tcl8.4.18/library
############ END NS 2.33 ##############################
I see that there is a SPACE on the following line after PATH=, which is an error.
export PATH= $PATH:$NS_HOME/bin:$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix
Remove all such spaces, save the file and logout from the terminal. Now, again login in the terminal with root. All commands will work.
---Maaz Rehan
|
|
|
All times are GMT -5. The time now is 12:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|