LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2008, 06:48 PM   #1
swift_a2002
LQ Newbie
 
Registered: May 2007
Posts: 28

Rep: Reputation: 15
bashrc file access permission denied


I have installed NS2-allain one-2.32 .now i am setting my path.but when ever i use ~/.bashrc command it say permission denied....what do do now..
 
Old 02-18-2008, 07:02 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
What are the permissions and ownership of .bashrc? You can display them with;

ls -l /home/(username)/.bashrc

-------------------
Steve Stites
 
Old 02-18-2008, 07:14 PM   #3
swift_a2002
LQ Newbie
 
Registered: May 2007
Posts: 28

Original Poster
Rep: Reputation: 15
this is what i get ..now what to do.

[mclamna@localhost ~]$ ls -l /home/mclamna/.bashrc
-rwxr----- 1 mclamna mclamna 124 Jul 12 2006 /home/mclamna/.bashrc
 
Old 02-18-2008, 07:22 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by swift_a2002 View Post
this is what i get ..now what to do.

[mclamna@localhost ~]$ ls -l /home/mclamna/.bashrc
-rwxr----- 1 mclamna mclamna 124 Jul 12 2006 /home/mclamna/.bashrc
That looks OK. I don't know why you were getting the permission denied message. Maybe I misunderstood your question. Are you trying to add a directory to your PATH by changing your PATH permanently in /.bashrc?

--------------------
Steve Stites
 
Old 02-18-2008, 08:47 PM   #5
swift_a2002
LQ Newbie
 
Registered: May 2007
Posts: 28

Original Poster
Rep: Reputation: 15
Actually i want to export my path varribale in .bashrc file ..so that i will not set every time i use ns...
so when i open this file permission denied come.
 
Old 02-18-2008, 09:05 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by swift_a2002 View Post
Actually i want to export my path varribale in .bashrc file ..so that i will not set every time i use ns...
so when i open this file permission denied come.
What command are you using to open /home/mclamna/.bashrc?

----------------------
Steve Stites
 
Old 02-18-2008, 09:27 PM   #7
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
you need to source the file -
Code:
. ~/.bashrc
It's not executable and can't be run directly otherwise. Er, well, it shouldn't be. But it is, so I'm not sure why you're getting that message either.

Last edited by slakmagik; 02-18-2008 at 09:29 PM. Reason: re-rtfp
 
Old 02-26-2008, 09:41 PM   #8
swift_a2002
LQ Newbie
 
Registered: May 2007
Posts: 28

Original Poster
Rep: Reputation: 15
what to do now how i will access my bashrc file
 
Old 02-26-2008, 11:15 PM   #9
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I know you've done some of this, but let's try it all at once. Type these three commands and their output, like this:
Code:
:ls -l ~/.bashrc
-rw------- 1 j users 14761 2008-02-26 15:11 /home/j/.bashrc

:head -1 ~/.bashrc
# Bourne-Again SHell run commands

:vim ~/.bashrc
Use whatever editor you want if you don't use vim and don't paste the output of the editor if it loads, even if it doesn't (clear the|use the alternate) screen, of course. But do post any error messages.

If it's owned by you and you have the 'rw' perms, you should be able to read/write it.
 
Old 02-27-2008, 02:37 AM   #10
swift_a2002
LQ Newbie
 
Registered: May 2007
Posts: 28

Original Poster
Rep: Reputation: 15
this is the result when i typed it



Quote:
[mclamna@localhost ~]$ ls -l ~/.bashrc
-rwxr----- 1 mclamna mclamna 124 Jul 12 2006 /home/mclamna/.bashrc
[mclamna@localhost ~]$ head - ~/.bashrc
==> standard input <==

now what to write here ...

2ndly when i checked the properties of bashrc file it doesnot giving me any read and write priviliges what to do .... how to add my path varriable in it
 
Old 02-27-2008, 05:46 AM   #11
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
That's supposed to be 'head -1'. Then the editor itself, if head shows you a line. In the meantime, you can just 'export PATH=$PATH:/path/you/want' from the command line and, as long as you don't exit that shell, you'll have that path.

Incidentally, few people would know what 'NS2-allain one-2.32' is (including myself) but I noticed elsewhere you were actually running on Cygwin. That kind of information can be important. Since you are, you can always try opening it in edit (in a dos box) or notepad. If you have a decent editor that won't screw up the line endings, you can even edit it in Windows. And make sure the program wants a Cygwin path vs. a Window path.
 
Old 02-27-2008, 06:41 PM   #12
swift_a2002
LQ Newbie
 
Registered: May 2007
Posts: 28

Original Poster
Rep: Reputation: 15
sorry for typo
now when i type this following message come
Quote:
$head -1 ~/.bashrc
$ .bashrc
i am working on fedora core 6.by specifying the path in command line its working fine.but i want to save it in bashrc file.how can i change it.
i was experimenting it to install NS2 on windows using cygwin.
but the problem i wrote is of linux...
 
Old 02-27-2008, 06:51 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Best thing is to go into your home dir and edit the file using eg vim:
vim .bashrc
or whichever editor you prefer.
My current work system doesn't have it, but iirc, PATH is usually set in the .bash_profile file.
Can't check my home system from here.
 
  


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
/root/bashrc PERMISSION DENIED when using runlevel 3 Berkut83 Red Hat 4 02-22-2010 08:44 PM
How to Access /root in linux if it says permission denied!!!! sid_Linux Linux - Software 3 02-28-2007 08:05 AM
SU'ing to user and getting ".bashrc permission denied" chris26 Slackware 7 11-23-2006 03:36 PM
Folder Access Problems: Permission Denied piva.francesco Linux - Software 3 03-28-2006 12:11 AM
smbmount works but I get permission denied when access the drive jeickal Linux - Networking 0 12-17-2004 11:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:18 AM.

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