1

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?

karel
  • 114,770
pranav
  • 79
  • 1
    Have you edited your .bash_profile (or one of the other alternatives) to modify your prompt or other? and introduced a typing error? or added something that did work, but have recently (since just before the error started appearing) removing a program which now produces the error? I would check these files and look for errors, especially files you've modified since install (ls -ltrha may provide a clue).... This is just a guess – guiverc Aug 09 '18 at 08:27
  • 1
    @guiverc Ubuntu uses .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

1 Answers1

0

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.

Ravexina
  • 55,668
  • 25
  • 164
  • 183