Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

-bash: your: No such file or directory

I see this when I open up Terminal. I an on a Macbook Pro with Sierra. I'm not sure what to do from here. Here is the whole thing:


Last login: Tue Apr 18 09:33:31 on ttys000

-bash: your: No such file or directory

JENs-MBP:~ sfjenn$

MacBook Pro, macOS Sierra (10.12.4), 15" display

Posted on Apr 18, 2017 9:52 AM

Reply
Question marked as Best reply

Posted on Apr 18, 2017 10:52 AM

This suggests that some command you have on your .bash_profile is giving an error.

This is a file in your home directory that contains commands that are executed when a bash shell starts.


Copy and paste the following command in a Terminal window and let us know what you get:


cat ~/.bash_profile

9 replies

Apr 18, 2017 11:36 PM in response to SFJenn

I'm guessing somehow your .bashrc file has some incorrect commands in it. Try renaming the file in Finder (you need to show invisible files to see it with Shift+Command+. keyboard shortcut) to something else (for example .bashrc_bad), and then start Terminal.app again. If that works you can then in the Terminal window:


cat ~/.bashrc_bad


and post the results and we can try and give you some input on what is bad.


Good luck...

Apr 19, 2017 2:18 AM in response to SFJenn

SFJenn wrote:


Hi thanks for responding. This is what I got:


export PATH=$PATH:/Users/<your username>/Library/Android/sdk/platform-tools/

JENs-MBP:~ sfjenn$


There you have it.

See the word "your" in there? Where it says "<your username>" it was supposed to be a placeholder, to be replaced by your short username (i.e., the name that appears next to the home folder in your Finder sidebar), but you left it literally.


The effect of that command (which, of course, is not working as it is) was to allow command line access to some tools for developing for Android. You obviously haven't been using those, at least not from the command line.

If you don't care about running stuff for running some sdk for Android from the command line, just delete this file by copying and pasting the following line exactly, to a Terminal window, and pressing enter:


rm ~/.bash_profile


The next time your ran bash (or open a new Terminal window) you won't see the error anymore.

Apr 20, 2017 2:23 AM in response to SFJenn

SFJenn wrote:


Yep it worked! Thanks so much! Is this similar to deleting a terminal .plist file? I couldn't find it earlier. I closed and quit terminal and then reopened it and get the below. This is what it should read correctly?


Last login: Wed Apr 19 10:10:09 on ttys000

JENs-MBP:~ sfjenn$


Yes, it is ok now.


When you open a Terminal window, a program called "bash" is run. This is the program that reads whatever you type and into this window and acts upon your commands (such a program is called a "shell" in Unix parlance).

The file you deleted (.bash_profile) can contain any list of commands to executed when bash starts.

[I guess we could compare it with the "login items" in System Preferences (programs that run every time you log in to your account).]

One of these commands had an error in it, so bash complained. Now it's gone and everything is fine.

-bash: your: No such file or directory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.