LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Commands not woking (https://www.linuxquestions.org/questions/linux-desktop-74/commands-not-woking-913586/)

mvanil 11-15-2011 12:13 AM

Commands not woking
 
Hi,

Commands not woking, its shows the message "command not found" even for ls command. I can't execute any commands in CLI,How can I solve the problem ?

regards

Anil

fukawi1 11-15-2011 12:23 AM

does it work if you specify the full path to the command?
ie:
Code:

$ /bin/ls
If so, something has gone wrong with your path.

Code:

$ echo $PATH
What does this show?

Check your .bashrc and .bash_profile as well as /etc/bashrc for the PATH variable.
It should go a little something like this (but possibly different)
Code:

/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:~/bin/:/usr/local/bin:/usr/local/sbin:/usr/local/usr/bin/:/root/bin

David the H. 11-15-2011 01:15 PM

In addition, how about giving us some details? Just saying "It doesn't work" doesn't do much good when you're trying to determine what the problem is.
  • What distribution are you using?
  • What shell are you using?
  • What terminal or terminal emulator are you using?
  • When did the problem start?
  • What did you do just before it started?
  • What have you tried so far to diagnose/remedy it?
  • Does it continue after restarting the shell, desktop, or system?
  • What other possibly relevant details can you give us?

http://www.catb.org/~esr/faqs/smart-questions.html

mvanil 11-16-2011 01:25 AM

I am using centos5.5, using bash shell. I can't login in GUI its showing an error
"Your session only lasted less than 10 sec" /etc/gdm/Presession/Default:Registering your session with u tmp........(~/.xsession-errors file).

When I login in CLI(ctrl+alt+f1) as root shows one message like
Sh:gzip:command not found
Bad character height 0


The result of echo $PATH is /usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/root/bin
So I have to export PATH=$PATH:/bin:/usr/local/bin

I checked the files .bashrc ,.bash_profile and /etc/bashrc , there is no changes.

fortran 11-16-2011 03:24 AM

I hope, it will help.
http://www.cyberciti.biz/faq/linux-u...get-rid-of-it/


All times are GMT -5. The time now is 08:32 PM.