5

This is initial screen I am getting on Ubuntu 12.04, when I open a terminal (Ctrl+Alt+T):

screenshot of terminal

That is, the text on the terminal is:

bash: /bin: Is a directory
chase@chase-desktop:~$ gedit ~/.bashrc
chase@chase-desktop:~$ source ~/.bashrc
bash: /bin: Is a directory
chase@chase-desktop:~$

Why is it appearing like this?

Before that I worked on terminals and edited .bashrc so many times, but i did not get those messages.

5
  • you made a mistake editing ~./bashrc.
    – Rinzwind
    Aug 7, 2014 at 10:00
  • 4
    Post the contents of your .bashrc file. You probably changed/added something to it that's executing something on /bin.
    – Alaa Ali
    Aug 7, 2014 at 10:47
  • You can try this answer. Aug 7, 2014 at 12:48
  • You could find the erroneous line via bash -x .bashrc, or maybe grep -n 'bin ' .bashrc
    – waltinator
    Aug 8, 2014 at 18:39
  • Besides ~/.bashrc, the problem might be in ~/.bash_profile or any other script called by ~/.bash_profile or ~/.bashrc. Other files (less used or less standard) could be ~/.profile, ~/.bash_aliases, or something similar. A nice description of these config files is here: serverfault.com/a/261807/248915.
    – jvriesem
    Jul 12, 2021 at 16:36

1 Answer 1

6

Apparently one of your modifications to .bashrc introduced an error that treats /bin like something other than a directory (for example, by trying to run it as an executable file, read data from or write data to it as a file, etc.). Because .bashrc runs when your interactive shell starts, the error message always appears.

You may be able to identify the error yourself by looking through your modifications to .bashrc.

(Otherwise, to identify the specific problem it will be necessary to see the contents of your .bashrc file. You can copy its entire contents to the clipboard and paste it into your question, select it in your question, and format it as code with Ctrl+K. If you've made this file, much, much longer than it usually is, it might be too long to put into your question in its entirety. In that case, you can post it at http://paste.ubuntu.com and edit your question to include a link to the posting.)

One possibility is that you may have introduced a space in a path starting with /bin. For example, near the beginning of the default .bashrc file is the code:

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

If you accidentally put a space after /bin (in SHELL=/bin/sh), this might produce such an error.

That is just one example, and not necessarily the most likely one.

3
  • 2
    If you are coming from Windows then one of the easiest mistakes to make is to separate folders in PATH (or any other path) with semicolon instead of colon. Eg instead of /usr/dir/one:/usr/dir/two you wrote /usr/dir/one;/usr/dir/two
    – MF.OX
    Mar 13, 2017 at 20:42
  • 2
    For me the issue was I had an extraneous ~ character floating around in my .bash_aliases. Once deleted and reopening the terminal, all good.
    – Alkarin
    Oct 12, 2018 at 23:23
  • 1
    Somehow all those ~ that Vi uses to show empty lines became actual tildes for me, so Bash tried to execute my home folder a bunch of times.
    – Noumenon
    Jun 15, 2023 at 6:46

Not the answer you're looking for? Browse other questions tagged .