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. |
echo $PATH
|
echo $PATH
Return /bin/ksh/ I have feeling I need to change some setting in the .profile |
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" |
*EDIT: Duplicate post*
|
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. |
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 Code:
SHELL=/usr/bin/ksh And to answer your question - to have bash as your default shell then you need Code:
SHELL=/usr/bin/bash |
Everyday I'm learning new things
thanks for the tip |
I am trying to install crossover and getting the message bash: $: not found. I am running SUSE 10 Pro. Can someone help?
thanks |
If you want to add a line to the PATH, do it like:
Code:
PATH=$PATH:/new/path:/another/new/path The $PATH bit means it includes what the currently set path is. What you put in changed the path, rather than adding to it. |
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:
So the only way for me to get that command to work is this Quote:
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.. |
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 |
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 I added the PATH on the shell and it works. Thanks |
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:
Quote:
~/.bash_profileWhen 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 |
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:00 AM. |