LinuxQuestions.org
Review your favorite Linux distribution.
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 08-19-2004, 07:50 PM   #1
MDBlueIce
Member
 
Registered: Aug 2004
Distribution: Suse Linux 9.1
Posts: 47

Rep: Reputation: 15
How Can I edit files that emacs won't let me?


I was recently trying to edit my /etc/bash.bashrc file to permanently change my command prompt by altering the PS1 variable ( feel free to let me know if there is a better way to do this ). When i open the file with emacs, I can not alte it, because emacs says the buffer is read-only. So how do I alter the file, through bash maybe? All help is kool.
 
Old 08-19-2004, 07:54 PM   #2
peace
Member
 
Registered: Jul 2003
Location: Canada
Posts: 214

Rep: Reputation: 31
It seems to be file permissions issue. See here:

andrew@dexter:~$ ls -l /etc/bash.bashrc
-rw-r--r-- 1 root root 508 May 8 12:43 /etc/bash.bashrc

It is read-only for everyone but the owner, root. 'su' into root and try to edit the file. Emacs will allow you to write to it then.
 
Old 08-19-2004, 08:37 PM   #3
MDBlueIce
Member
 
Registered: Aug 2004
Distribution: Suse Linux 9.1
Posts: 47

Original Poster
Rep: Reputation: 15
Weird...... I used the SU command to switch users to root like you advised. Then i tried to launch xemacs, i wasnt able to. I thought maybe it was just an issue with xemacs, so I tried emacs but I still got an error message. Then I tried xmms, but I couldnt run that either. Here are the error messages ( I have no idea what to make of them )...................

================================================================

drakeDoogle@linux:~> su root
Password:
linux:/home/lxuser # xemacs
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

X server not responding
: ":0.0"
linux:/home/lxuser # emacs
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

linux:/home/lxuser # xmms
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


** CRITICAL **: Unable to open display

==============================================================


Any idea what this means? Thanx again.
 
  


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
vi to edit files?? Andknig Linux - Newbie 2 04-22-2005 04:18 AM
.el files in emacs skibud2 Linux - Software 1 01-26-2005 12:27 PM
how do i edit files???? zexter Mandriva 9 11-06-2004 10:02 AM
Edit files help flira Linux - Newbie 2 05-27-2004 09:31 PM
Edit files thread flira Slackware 2 05-27-2004 08:33 PM

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

All times are GMT -5. The time now is 09:11 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