Ask Your Question
0

bash error: command not found

asked 2012-12-21 05:06:23 -0600

ngar gravatar image

updated 2014-09-28 15:35:14 -0600

mether gravatar image

I think I have done a very big blunder in Fedora 17 64 bit machine. I needed to add a path in .bashrc file so I did but i have mixed up somewhere. Now when I type any command in .bashrc, it comes back with command not found error.

I was using as a root user and the result now looks like this:

bash: _64_nodap_gcc432/bin:/home/srinivasa.purimitla/mm5/ncl_ncarg-6.1.0.Linux_Debian_x86: No such file or directory
bash: ls: command not found
bash: tty: command not found
[root@srinivasa srinivasa.purimitla]# gedit ~/.bashrc
bash: gedit: command not found...
[root@srinivasa srinivasa.purimitla]# vim ~/.bashrc
bash: vim: command not found...
[root@srinivasa srinivasa.purimitla]#

I hope someone could help me with this. I installed it using a complete setup from DVD. I appreciate any help provided.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2012-12-27 02:43:24 -0600

ngar gravatar image

Thanks guys for your replies. I apologize for late reply. I actually installed a cleaner version of fedora again, though not the best way but being a newbie i chose to do that way.

edit flag offensive delete link more
0

answered 2012-12-21 07:27:30 -0600

Jomoos gravatar image

updated 2012-12-21 09:14:13 -0600

It seems like you have edited out a lot from your .bashrc file. Well, here is the default .bashrc from my 64bit Fedora 17.

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

# User specific aliases and functions

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

If you want to add a path, ten do that just before "export PATH". For example, if you want to add the paths "~/android-sdk-linux/tools" and "~/android-sdk-linux/platform-tools" then:

...

# User specific aliases and functions

PATH=$PATH:$HOME/.local/bin:$HOME/bin

# additional paths
PATH=$PATH:$HOME/.apps/android-sdk-linux/tools
PATH=$PATH:$HOME/.apps/android-sdk-linux/platform-tools

export PATH

Since your path is lost, you need to execute the editor program with absolute path. For example, using vi editor is as follows:

[root@srinivasa srinivasa.purimitla]# /usr/bin/vi ~/.bashrc

Or with graphical gedit as

[root@srinivasa srinivasa.purimitla]# /usr/bin/gedit ~/.bashrc
edit flag offensive delete link more

Comments

@wholevin That's a good point. I updated my answer.

Jomoos gravatar imageJomoos ( 2012-12-21 09:17:09 -0600 )edit
1

If you need it, there is always a spare copy of .bashrc on hand in /etc/skel ! /usr/bin/cp /etc/skel/.bashrc ~/.bashrc will get you a fresh start.

randomuser gravatar imagerandomuser ( 2012-12-22 03:13:48 -0600 )edit
0

answered 2012-12-21 08:27:36 -0600

davidva gravatar image

Hi, Its a file or directory? "nclncarg-6.1.0.LinuxDebian_x86"

Do you need administrative privileges or root to edit ".bashrc"? This is not necessary...

as normal user try...

gedit $HOME/.bashrc

If you need edit the real bashrc, it is the path /etc/bashrc (Not recommended if you do not know what you are doing.)

to invoke gedit with administrative privileges must do so in the following manner.

su 

sudo gedit /etc/bashrc
edit flag offensive delete link more

Comments

Root has a .bashrc too; I'm guessing ngar wants to configure the shell environment for root. As for invoking gedit, there is nothing different about the method he is using and what you are telling him to do. However, you are telling him to edit a GLOBAL file, which affects all users, where making the needed changes for the desired user might suffice.

randomuser gravatar imagerandomuser ( 2012-12-22 03:18:30 -0600 )edit

Question Tools

Stats

Asked: 2012-12-21 05:06:23 -0600

Seen: 10,130 times

Last updated: Dec 27 '12