LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-23-2010, 02:01 AM   #1
danielle
LQ Newbie
 
Registered: Oct 2010
Location: Beijing
Distribution: Fedora
Posts: 8

Rep: Reputation: 0
How to fix my bash? All command not found...!


Hi,

I added $PATH=/usr/local/mysql to .bashrc_profile and I guess I wrote it in the wrong place...now when I log in my fedora the terminal says:
-bash: dircolors: command not found
-bash: cut: command not found
-bash: cut: command not found
-bash: id: command not found
-bash: id: command not found
-bash: id: command not found
-bash: [: too many arguments
-bash: tput: command not found
-bash: tput: command not found
-bash: wc: command not found
-bash: [: : integer expression expected

actually most command is not found...such as ls, vi... perhaps 'cd' is the only cmd I can use...

The result I type 'echo $PATH'
:/usr/local/mysql
so...how can I fix it? I cannot edit bash file with vi...

thanks!
 
Old 10-23-2010, 02:18 AM   #2
codegenie
LQ Newbie
 
Registered: Oct 2010
Distribution: Redhat
Posts: 24

Rep: Reputation: -3
wrong syntax

@Danielle
U wer supposed to append ur custom path to the already defined unix path's.
wat u did is... u assigned just a single path by typing..
$PATH=/usr/local/mysql


to repair open the file graphically ..
and replace that line with $PATH=$PATH:/usr/local/mysql

or type /usr/bin/vim ~/.bashrc_profile

and edit it in the terminal mode lyk i said.
HOPE IT WORKs.cheerio
 
1 members found this post helpful.
Old 10-23-2010, 03:01 AM   #3
danielle
LQ Newbie
 
Registered: Oct 2010
Location: Beijing
Distribution: Fedora
Posts: 8

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by codegenie View Post
@Danielle
U wer supposed to append ur custom path to the already defined unix path's.
wat u did is... u assigned just a single path by typing..
$PATH=/usr/local/mysql


to repair open the file graphically ..
and replace that line with $PATH=$PATH:/usr/local/mysql

or type /usr/bin/vim ~/.bashrc_profile

and edit it in the terminal mode lyk i said.
HOPE IT WORKs.cheerio
Hi,

Thanks, I recover my .bash_profile now. It likes:
Code:
PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH
I log again but the problems still there...
what now echo $PATH is:
/usr/local/mysql/:/usr/local/jdk/bin:/usr/local/jdk/jre/bin:/root/bin

any ideas? Thanks a lot!
 
Old 10-23-2010, 03:04 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You need at least /bin, /usr/bin and probably /usr/local/bin in there. For root, you'll also want /sbin and /usr/sbin.

Again, these are probably the least you'll need to get things working. You'll probably find you need to add more directories..

Last edited by Nylex; 10-23-2010 at 03:06 AM.
 
Old 10-23-2010, 03:20 AM   #5
codegenie
LQ Newbie
 
Registered: Oct 2010
Distribution: Redhat
Posts: 24

Rep: Reputation: -3
U need these in ur path .. to access all the commands

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

add these too explicitly if ur (echo $PATH) doesnt show this.

$PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
Old 10-23-2010, 03:23 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by codegenie View Post
$PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
The left-hand side of the equals sign should just be PATH, rather than $PATH.
 
Old 10-23-2010, 03:36 AM   #7
codegenie
LQ Newbie
 
Registered: Oct 2010
Distribution: Redhat
Posts: 24

Rep: Reputation: -3
sry for that...
just a typo..
tnx nylex for correctig it..
 
Old 10-23-2010, 03:46 AM   #8
danielle
LQ Newbie
 
Registered: Oct 2010
Location: Beijing
Distribution: Fedora
Posts: 8

Original Poster
Rep: Reputation: 0
thanks all of you~It works now
 
Old 10-23-2010, 03:56 AM   #9
codegenie
LQ Newbie
 
Registered: Oct 2010
Distribution: Redhat
Posts: 24

Rep: Reputation: -3
mark it solved..
 
  


Reply



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
[SOLVED] Bash command not found bluebird58 Linux - Newbie 11 08-17-2010 09:09 AM
bash: command not found Pengye Linux - General 5 06-01-2008 11:57 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
-bash: cp: command not found johnlittlepeap Fedora 2 11-15-2004 08:52 AM
bash: ll: command not found x2000koh Linux - Newbie 3 08-08-2003 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:13 PM.

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