As soon as I open my terminal I get:
$: command not found
$: command not found
Even if I close and open again I get the same.
$: command not found
$: command not found
How to sort out this problem?
As soon as I open my terminal I get:
$: command not found
$: command not found
Even if I close and open again I get the same.
$: command not found
$: command not found
How to sort out this problem?
First run this command:
grep -E '^\$' .bashrc -c
It should give you a number greater than of 0, which means your .bashrc
contains some lines started with $
.
Run this command:
sed -r -i.bak 's/^\$.*//' .bashrc .profile
it should fix the issue by editing and removing the offending lines in your .bashrc
and .profile
files. The original files will be backed up with the .bak
suffix.
There is two $
somewhere in your .bashrc
, every time you open a new terminal .bashrc
will be sourced and thus bash try to run the $
as command which there is no such a command and bash complains about it with command not found
.
sed
command fixed the issue by removing the $
from .bashrc
.
– Ravexina
Aug 09 '18 at 08:59
grep
before the sed
... if you get 0
by running grep
then there is no problem any more ;)
– Ravexina
Aug 09 '18 at 09:01
ls -ltrha
may provide a clue).... This is just a guess – guiverc Aug 09 '18 at 08:27.profile
instead of.bash_profile
and I guess the problem should raise from.bashrc
because.profile
and.bash_profile
only get sourced once at login time and not every time you open a new terminal. – Ravexina Aug 09 '18 at 08:36