Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-23-2009, 09:18 AM   #1
LQ Newbie
Registered: Nov 2007
Posts: 9

Rep: Reputation: 0
ls command not working

Hi there

i am using cent os 5.2 on a hosting having plesk as i have ssh access i was working with the apache ant and my java path was not getting setup

so i accidentally did this

PATH=$(echo $PATH | sed -e 's;:\?/home/user/bin;;' -e 's;/home/user/bin:\?;;')

If you need, you can re-add it at the front of the list with:


Or you can re-add it at the end of the list with:


after that my ls command is not working and nothing is working
no command is working

can anybody help

how can i fix the whole thing
Old 05-23-2009, 09:21 AM   #2
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Thats some accident...
Whats in your path at the moment? What is the output of
/bin/echo $PATH

Last edited by jamescondron; 05-23-2009 at 09:22 AM. Reason: Correction, absolute command
Old 05-23-2009, 09:25 AM   #3
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,194

Rep: Reputation: 105Reputation: 105
try `/bin/echo $PATH`

seems pretty obvious that you borked your $PATH so that it doesn't include the basic bin directories where your system's commands are. Put them back in $PATH.

if you can't figure that out, break your connection, log in again, and don't do that again.
Old 05-23-2009, 09:27 AM   #4
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 58
If you exit the ssh and ssh back in, the $PATH should be reset to whatever the login uses.

Old 05-23-2009, 07:52 PM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
This might help. On my Centos 5.3 my default PATH is



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
./configure command isn't working in command line jumpmansbro Linux - Newbie 20 01-22-2009 08:29 PM
at command not working raj_hcl1986@rediffma Linux - Newbie 7 12-06-2008 12:32 PM
mv command not working lqchangba AIX 9 07-23-2008 09:31 PM
su command not working dahmad Linux - Newbie 6 02-28-2003 12:08 AM
ps command not working slackerboy Slackware 2 08-22-2002 11:01 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration