parse_git_dirty:11: command not found: tail - terminal

I was following this tutorial to try and be able to open Sublime text from terminal but I messed up along the way and now I keep getting this error in terminal:
parse_git_dirty:11: command not found: tail
I can't even seem to run this command:
open ~/.bash_profile
Which returns this:
zsh: command not found: open
parse_git_dirty:11: command not found: tail

I figured out what I messed up.
In following the tutorial, I embarrassingly added
export PATH=/usr/local/bin:(...)
including the ... and saved the file. I didn't realize it would mess everything up. I was able to figure out where bash_profile is saved and edit the file manually.

Related

Command not found when opening terminal, possible conda issue?

for some reason whenever I open my terminal it immediately prints the following (after the "last login" line of course):
(eval):116: command not found: dirname
(eval):116: command not found: dirname
__add_sys_prefix_to_path:6: command not found: dirname
__add_sys_prefix_to_path:7: command not found: dirname
It appears that terminal still works fine, but I can't seem to figure out what the cause of these errors could be. The only thing I've "changed" in my terminal last time I used it was setting up a conda environment and installing some new packages.
Any ideas?
You have tampered with the PATH variable and your current PATH cannot figure out where your common utilities are located.
try:
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}
export PATH
Fix the last entry you made in your bash_profile or zshrc file before you started encountering the error.

How to fix the invalid identifier of bash?

When I open terminal, I get following error at the top.
bash: export: `/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/root/bin': not a valid identifier
I am new to linux and I was trying to execute ls command but it was not working and giving some error so I followed this answer to fix it. Now I am able to list down the file using ls command but getting this error. I wonder it will have some serious affect somewhere else or not.
Turns out my path in ~/.bashrc was not correct. So this is what I did.
gedit ~/.bashrc
After the in the opened file I update the PATH to this at the end of the file.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

How to fix the terminal "source" command on OSX Catalina

I try executing the below commands in my terminal.
$ source ~/.bash_profile or . ~/.bash_profile
and the system returns:
-bash: [[-s: command not found
I cannot think of anything extra information to provide.
I kept researching my issue and came across this stackoverflow post
I initially misunderstood the error message to mean the source command was not found. After reading the other post I tried running bash .bash_profile and the result was .bash_profile: line 11: [[-s: command not found. I had an error in my .bash_profile file. I commented out the line and tried running source .bash_profile and it worked.
The initial command not found did not relate to the source command, it related to the file I was running with source.
I hope this helps someone else.

Basic command lines on Mac terminal not working

I changed the bash profile while trying to install mongodb and none of my command lines are working on terminal. I read online that I need to fix the $PATH but I can't even access it when none of my commands are working.
Help?
Mistakenly I also ran into same problem where to resolve this I had to reset my PATH variable to basic settings as below :
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin"
Once you set PATH variable now you can open the .bash_profile file in same terminal session only and make changes accordingly. This will resolve your problem.
Ok I found the answer from here:
"Open Terminal, and go to File (or Shell) -> New Command. Type in open -e .profile (or substitute some other file instead of .profile), and hit Run. That should open TextEdit with the file you want to fix; you can remove the offending lines there."
in my case i typed in nano .bash_profile and that allowed me to edit my bash profile and fix the issue.
can't use terminal from error in .bash_profile
Run this in terminal:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

How to get Terminal on OSX to start up clearly?

I am new to Mac OSX. Once after i typed export command in terminal, each time i start up the terminal, two messages show up:
-bash: export: '=': not a valid identifier
-bash: export: `:/Users/Li/File/Java/TStream': not a valid identifier
I know that clear and command+k can got a clean screen. But I just want to start up with a clean terminal.
Go to your terminal and type the
clear
command. This should clear your screen. Maybe what you're looking for is a way to have bash run that each time. If so, cd to your home directory:
cd ~
then edit the file called .bash_profile , or maybe .bashrc
On the last line write the word 'clear' without quotes, then save. This file runs when bash starts up, and the last thing it will do, therefore, is clear the screen.
For more info, checkout: this
EDIT:
Incidentally, I just realized you might want to clear the error. When you open up your .bashrc file, see if you can find a line that resembles the error you're getting, then comment it out.

Resources