Omnipresent IT Solutions Pvt Ltd

Sunday, August 2, 2009

bash: ls: command not found

Don't Worry

This occurs when you edit your .bashrc file in your home folder
Suppose you edited your /root/.bashrc file as root folder.. Then you will not be able to do any commands.. No other users can change roots file also..

Solution
--------------
Take the terminal
[sarith@acerfedora ~]$ export PATH=/bin or to the path where your ls executable resides
Now you will be able to work with ls command. Come to home folder of the user

[sarith@acerfedora ~]$ export PATH=/usr/bin

Now you will be able to use gedit or vi or any other editor.Edit .bashrc file
Delete the path you added or Add path to all directories like
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/u01/app/oracle/product/11.1.0/db_1/bin:/home/sarith/bin

Exit the shell.. It started working again.. If any other problems mail me
sarithdivakar@yahoo.co.in

Bash

NAME
bash - GNU Bourne-Again SHell



DESCRIPTION
Bash is an sh-compatible command language interpreter that executes
commands read from the standard input or from a file. Bash also incor-
porates useful features from the Korn and C shells (ksh and csh).

When Bash starts, it executes the commands in a variety of different scripts.

When Bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

When a login shell exits, Bash reads and executes commands from the file ~/.bash_logout, if it exists.

When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force Bash to read and execute commands from file instead of ~/.bashrc.

No comments: