How to fix the "-bash: command not found" error?

1

I get this every time I open terminal on my mac after a ruby course:

-bash: xzc: command not found
-bash: z: No such file or directory
-bash: cx: command not found
-bash: zcx: No such file or directory
-bash: zcx: No such file or directory
-bash: cz: command not found

How do I fix it?

Nikolaj

Posted 2012-08-04T13:39:58.323

Reputation: 11

Do you have Terminal already open during the course or do you open it after you finished the course? – nohillside – 2012-08-04T13:43:09.937

Are these the actual lines you're seeing? Can you describe exactly what you're doing and what leads to these errors? – slhck – 2012-08-04T14:59:19.090

They are shown every time I open the terminal app – Nikolaj – 2012-08-11T12:07:58.610

Answers

1

It looks like you created a shell initialization file with a bunch of gibberish in it (from the keys, it looks like you were trying to type editing commands, and they got inserted as text). The file will be an invisible file in your home folder, with one of the following names: .bash_profile, .bash_login, .profile, or .bashrc. You can list invisible files in your home folder with the command ls -A ~

Fixing the file may be tricky, since there may be things in it that you need to keep as well as gibberish that needs to be deleted. And if you're having trouble editing files, that's just going to add to the confusion...

Gordon Davisson

Posted 2012-08-04T13:39:58.323

Reputation: 28 538