Why there is a "command not found" prompt every time I open the Terminal?
Linux - GeneralThis 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.
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.
This is a sample setup for both .bashrc & .bash_profile(which is used to source the .bashrc) for users home;
Code:
sample .bash_profile for proper sourcing with users home;
~$ cat .bash_profile
#.bash_profile file begins here
# .bash_profile to source .bashrc
#08-30-06 12:21
# Source .bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi #file ends here
Code:
sample .bashrc;
:~$ cat .bashrc
#.bashrc begins here
#08-30-06 12:20
# Add bin to path
export PATH="$PATH:/sbin:/usr/sbin:$HOME/bin"
#export PATH="$PATH:$HOME/bin"
# Dynamic resizing
shopt -s checkwinsize
# Custom prompt
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#08-29-06 11:40
if [ `id -un` = root ]; then
PS1='\[\033[1;31m\]\h:\w\$\[\033[0m\] '
else
PS1='\[\033[1;32m\]\h:\w\$\[\033[0m\] '
fi
#
# Add color
eval `dircolors -b`
# User defined aliases
alias cls='clear'
alias clls='clear; ls'
alias ll='ls -l'
alias lsa='ls -A'
alias lsg='ls | grep'
alias lsp='ls -1 /var/log/packages/ > package-list'
alias na='nano'
alias web='links -g -download-dir ~/ www.google.com'
#08-29-06 11:50
#To clean up and cover your tracks once you log off
#Depending on your version of BASH, you might have to use
# the other form of this command
trap "rm -f ~$LOGNAME/.bash_history" 0
#The older KSH-style form
# trap 0 rm -f ~$LOGNAME/.bash_history
The .bashrc & .bash_profile are very useful for users!
HTH!
The sequence \357\273\277 is the octal representation of the Byte Order Mark of UTF-8 character encoding. Here is a comparative table:
Code:
Hex | EF BB BF
Dec | 239 187 191
Oct | 357 273 277
Bin | 11101111 10111011 10111111
Most likely your terminal is not UTF-8 capable and it tries to interpret these three characters literally. Which terminal are you running? And which (Linux) OS is this? You have two possibilities:
1. make your terminal UTF-8 capable
2. convert all the UTF-8 files to another encoding, e.g. plain ASCII
Another question: what is the output of the following commands?
The sequence \357\273\277 is the octal representation of the Byte Order Mark of UTF-8 character encoding. Here is a comparative table:
Code:
Hex | EF BB BF
Dec | 239 187 191
Oct | 357 273 277
Bin | 11101111 10111011 10111111
Most likely your terminal is not UTF-8 capable and it tries to interpret these three characters literally. Which terminal are you running? And which (Linux) OS is this? You have two possibilities:
1. make your terminal UTF-8 capable
2. convert all the UTF-8 files to another encoding, e.g. plain ASCII
Another question: what is the output of the following commands?
Code:
echo $PS1 | od -c
echo -e $PS1 | od -c
thanks, I am using gnome-terminal under Fedora 16.
How to make my terminal UTF-8 capable?
Here are the output:
[root@localhost ~]# echo $PS1 | od -c
0000000 [ \ u @ \ h \ W ] \ $ \n
0000015
[root@localhost ~]# echo -e $PS1 | od -c
0000000 [ \ u @ \ h \ W ] \ $ \n
0000015
thanks, I am using gnome-terminal under Fedora 16.
How to make my terminal UTF-8 capable?
It should be already enabled. What is the output of the following?
Code:
locale
I notice you run the commands as root. Does the problem happen as normal user or as root, as well? You should run all the suggested commands as the user whose prompt is
Code:
bash: $'\357\273\277#': commands not found.
Please, use CODE tags around the code you copy/paste from your terminal. To use CODE tags put [CODE] and [/CODE] before and after the code, respectively. Thank you.
It should be already enabled. What is the output of the following?
Code:
locale
I notice you run the commands as root. Does the problem happen as normal user or as root, as well? You should run all the suggested commands as the user whose prompt is
Code:
bash: $'\357\273\277#': commands not found.
Please, use CODE tags around the code you copy/paste from your terminal. To use CODE tags put [CODE] and [/CODE] before and after the code, respectively. Thank you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.