Command 'ls' is available in '/bin/ls'

Every time when I enter my user in ubuntu I get this error:

Command 'ls' is available in '/bin/ls'

and I solved it by:

export PATH=/usr/bin:/bin

but the problem is when I end the session and reenter, the same error appear ..

I'm beginner in using ubuntu OS, also I'm working in an account without sudo access ..

Edited: as @steeldriver requested in the comments:

> /usr/bin/diff /etc/skel/.bashrc ~/.bashrc
export PATH=/home/bghanem/python/python27/bin
export PATH="~/anaconda/bin:$PATH"
10

4 Answers

According to the diff output, your problem is definitely inside your ~/.bashrc. You should correct it by editing. (To edit files in your home directory (~), root permissions should not be necessary unless something else is messed up.)

In the first export command, you overwrite the current PATH contents by not including $PATH. To extend the existing list, the command should read:

export PATH="/home/bghanem/python/python27/bin:$PATH"

You can also merge both export commands into one. Moreover, you should use $HOME instead of ~ when setting the PATH variable (thanks @DavidFoerster for the explanation!), so the result is:

export PATH="$HOME/anaconda/bin:$HOME/python/python27/bin:$PATH"

Use your favorite editor to edit the file. In your current situation, you might need to invoke it using the full path, e.g. /bin/nano. After that, don’t forget to reload .bashrc using . ~/.bashrc or by opening a new shell.

8

You have to edit 3 files :

  • ~/.bashrc and ~/.profile

You must add your command line in both files, at the end (your command line is export PATH=$PATH:/usr/bin:/bin)

  • /etc/environment

You must add your command at the end of the file, but without export (in your case, just add PATH=$PATH:/usr/bin:/bin)

Now, to apply your change, you have to reboot your computer, or you can also type these following commands which will apply these changes without reboot :

source ~/.bashrc
source ~/.profile

NB : don't forget the $PATH inside your export, PATH isn't empty so you can have some issues if you forget to add it

7

open ./bashrc in any editor then write at the end of file

PATH="$PATH:/usr/bin:/bin"

or you can add as many path appending to it ":path" and then update it by

source ./bashrc

I solved it following the answer here: Setting "export PATH=/usr/bin:/bin" permnently

I edited ~/.bashrc file:

pico ~/.bashrc

at the end of the file I found these lines:

PATH="/home/common/bin:$PATH"
export PATH=/home/MY_USER/python/python27/bin
export PATH="~/anaconda/bin:$PATH"

I added below them:

PATH="/usr/bin:/bin"

and I saved it ..

8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like