bash command not found
Hey there
Is anyone familiar with the following? : -bash: id: command not found -bash: dircolors: command not found -bash: biff: command not found -bash: dircolors: command not found -bash: id: command not found BT ~ $ This happens whenever i start the terminal window. I was having a problem with my javac and java and I made some changes to profile and .bash_profile files. The fact is that finally i fixed java and javac but now i got this problem. Many thanks for your time and for sharing your knowledge Manolakis |
Could you post your .bash_profile and .bashrc
|
Chances are you removed the /bin and/or /usr/bin directories from your $PATH. These directories are where many Linux system executables are stored so they need to be in your $PATH or you'll see results like what you posted.
|
Quote:
|
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells. # Set the values for some environment variables: export MINICOM="-c on" export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man export HOSTNAME="`cat /etc/HOSTNAME`" export LESSOPEN="|lesspipe.sh %s" export LESS="-M" # If the user doesn't have a .inputrc, use the one in /etc. if [ ! -r "$HOME/.inputrc" ]; then export INPUTRC=/etc/inputrc fi # Set the default system $PATH: PATH="/usr/local/jdk1.6.0/bin/" # For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in # the $PATH. Some means of connection don't add these by default (sshd comes # to mind). if [ "`id -u`" = "0" ]; then echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null if [ ! $? = 0 ]; then PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH fi fi # I had problems using 'eval tset' instead of 'TERM=', but you might want to # try it anyway. I think with the right /etc/termcap it would work great. # eval `tset -sQ "$TERM"` if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then TERM=linux fi # Set ksh93 visual editing mode: if [ "$SHELL" = "/bin/ksh" ]; then VISUAL=emacs # VISUAL=gmacs # VISUAL=vi fi # Set a default shell prompt: #PS1='`hostname`:`pwd`# ' if [ "$SHELL" = "/bin/pdksh" ]; then PS1='! $ ' elif [ "$SHELL" = "/bin/ksh" ]; then PS1='! ${PWD/#$HOME/~}$ ' elif [ "$SHELL" = "/bin/zsh" ]; then PS1='%n@%m:%~%# ' elif [ "$SHELL" = "/bin/ash" ]; then PS1='$ ' else #My colour additions (muts) #PS1="\u@\h:\w\$ " #PS1="\[\033[1;34m\]\u@\h:\w\$ \033[0m " #PS1='\[\e[34;1m\]\u@\h:\w\$ \[\e[0m\]' PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]' fi PS2='> ' export PATH DISPLAY LESS TERM PS1 PS2 # Default umask. A umask of 022 prevents new files from being created group # and world writable. umask 022 # Set up the LS_COLORS and LS_OPTIONS environment variables for color ls: if [ "$SHELL" = "/bin/zsh" ]; then eval `dircolors -z` elif [ "$SHELL" = "/bin/ash" ]; then eval `dircolors -s` else eval `dircolors -b` fi # Notify user of incoming mail. This can be overridden in the user's # local startup file (~/.bash.login or whatever, depending on the shell) if [ -x /usr/bin/biff ]; then biff y fi # Append any additional sh scripts found in /etc/profile.d/: for profile_script in /etc/profile.d/*.sh ; do if [ -x $profile_script ]; then . $profile_script fi done unset profile_script # For non-root users, add the current directory to the search path: if [ ! "`id -u`" = "0" ]; then PATH="$PATH:/usr/local/jdk1.6.0/bin/." fi ############################################### ############################################### |
What i post before was the .bash_profile file.I cannot find .bashrc Well i think that i have made a big mistake.When i rebooted my pc i could not use the startx not even su and i decided to reinstall BackTrack(My linux) and to create a new user
The fact now is that javac again is not recognized Please can you explain how exactly should these files be(.bash_profile && .bashrc) What can i do now that i have lost .bashrc? Many thanks for dedicating your time Manolakis |
.bashrc
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells. # Set the values for some environment variables: export MINICOM="-c on" export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man export HOSTNAME="`cat /etc/HOSTNAME`" export LESSOPEN="|lesspipe.sh %s" export LESS="-M" # If the user doesn't have a .inputrc, use the one in /etc. if [ ! -r "$HOME/.inputrc" ]; then export INPUTRC=/etc/inputrc fi # Set the default system $PATH: PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/apache/bin:/usr/local/pgsql/bin:/opt/mono/bin:/usr/local/pgsql/bin:." # For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in # the $PATH. Some means of connection don't add these by default (sshd comes # to mind). if [ "`id -u`" = "0" ]; then echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null if [ ! $? = 0 ]; then PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH fi fi # I had problems using 'eval tset' instead of 'TERM=', but you might want to # try it anyway. I think with the right /etc/termcap it would work great. # eval `tset -sQ "$TERM"` if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then TERM=linux fi # Set ksh93 visual editing mode: if [ "$SHELL" = "/bin/ksh" ]; then VISUAL=emacs # VISUAL=gmacs # VISUAL=vi fi # Set a default shell prompt: #PS1='`hostname`:`pwd`# ' if [ "$SHELL" = "/bin/pdksh" ]; then PS1='! $ ' elif [ "$SHELL" = "/bin/ksh" ]; then PS1='! ${PWD/#$HOME/~}$ ' elif [ "$SHELL" = "/bin/zsh" ]; then PS1='%n@%m:%~%# ' elif [ "$SHELL" = "/bin/ash" ]; then PS1='$ ' else #My colour additions (muts) #PS1="\u@\h:\w\$ " #PS1="\[\033[1;34m\]\u@\h:\w\$ \033[0m " #PS1='\[\e[34;1m\]\u@\h:\w\$ \[\e[0m\]' PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]' fi PS2='> ' export PATH DISPLAY LESS TERM PS1 PS2 # Default umask. A umask of 022 prevents new files from being created group # and world writable. umask 022 # Set up the LS_COLORS and LS_OPTIONS environment variables for color ls: if [ "$SHELL" = "/bin/zsh" ]; then eval `dircolors -z` elif [ "$SHELL" = "/bin/ash" ]; then eval `dircolors -s` else eval `dircolors -b` fi # Notify user of incoming mail. This can be overridden in the user's # local startup file (~/.bash.login or whatever, depending on the shell) if [ -x /usr/bin/biff ]; then biff y fi # Append any additional sh scripts found in /etc/profile.d/: for profile_script in /etc/profile.d/*.sh ; do if [ -x $profile_script ]; then . $profile_script fi done unset profile_script # For non-root users, add the current directory to the search path: if [ ! "`id -u`" = "0" ]; then PATH="$PATH:/usr/local/jdk1.6.0/bin/." fi |
It's generally best not to modify /etc/profile but to make your own .bash_profile and .bashrc which will keep you from screwing up the global environment. I noticed inthe above scripts you had used commands like id before you had added the standard /bin and /usr/bin directories to the $PATH.
Here's what I would do if I were you. 1) Create a .bash_profile script in your home directory with the following content: Code:
if [ -f ~/.bashrc ]; then Code:
export PATH=$PATH:/usr/local/jdk1.6.0/bin |
Quote:
|
Hey again
I just want to ask smth to be sure. When you say in your home directory you probably mean(setting the case that i am the user 'newbie') /home/newbie/ Is that right? If that is right i have to say that a .bashrc already exists in there. Do i have to erase everything in that file and only put the export statement that you gave me or just to put the export statement where the others are? I did what you said and again javac cannot be found. You said before that it is not good to modify the etc/profile Unfortunately for me i made some changes to that files and i am quite afraid that i dont remember which changes i have to take back. Any ideas what i can do? Please any advice will be grateful |
not desirable 'which java'
Hey there
I made javac being recognized but now i have another problem. When i try to run a java file after compilation i get an error that indicates that the versions of javac and java are not the same which java outputs: /usr/lib/java/bin/java now in my case i believe which javac should output: /usr/local/jdk1.6.0/bin/java Any ideas? Dont know how to thank u for your precious help. Manolakis |
BT ~ $ which -a java
/usr/lib/java/bin/java /usr/local/jdk1.6.0/bin/java I just noticed that which java with option -a outputs the above I thougth that this could be useful Thanks again |
Quote:
Code:
export PATH=$PATH:/usr/local/jdk1.6.0/bin Code:
export PATH=/usr/local/jdk1.6.0/bin:$PATH |
Yeap
Finally it works. Honestly i dont know how to thank u. :) :) :) :) :) :) It was really nice of you. Can i ask the last question? What kind of programming language is that? I mean the code in the profile & bashrc ,etc. |
All times are GMT -5. The time now is 05:57 PM. |