LinuxQuestions.org
Help answer threads with 0 replies.
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 09-30-2004, 05:36 PM   #1
JNaas
Member
 
Registered: Sep 2004
Posts: 43

Rep: Reputation: 15
the noobest question of them all


How do i edit a file/script in console as root??
 
Old 09-30-2004, 05:51 PM   #2
jjflash53
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
vi or emacs or maybe Midnight Commander

Last edited by jjflash53; 09-30-2004 at 05:54 PM.
 
Old 09-30-2004, 05:52 PM   #3
greg108
Member
 
Registered: Aug 2003
Location: CA USA
Distribution: FC2, FC4, Mandrake 10, Slackware 10, RedHat 9, Suse 9.1, College Linux, Debian Sarge, Gentoo
Posts: 170

Rep: Reputation: 30
use vi editor.
you can open text file:

vi filename

you have to learn some simple command in vi.

here is one tutorial:

http://locutus.kingwoodcable.com/jfd/vi.html

also

man vi
 
Old 09-30-2004, 05:52 PM   #4
JNaas
Member
 
Registered: Sep 2004
Posts: 43

Original Poster
Rep: Reputation: 15
dude??? i'm the noob'est noob!!!!!
 
Old 09-30-2004, 05:53 PM   #5
mugstar
Member
 
Registered: Jun 2004
Location: Scotland
Distribution: Anything that'll install...
Posts: 305

Rep: Reputation: 30
It depends which console-based text editor is installed on your system.

Try (and these are in *no*particular*order* - no flame war, please!):

man nano
man pico
man emacs
man vim

Whichever one works, read the manual to learn the basic commands then fire it up like this:

nano /path/to/filename
 
Old 09-30-2004, 05:53 PM   #6
pogromca
LQ Newbie
 
Registered: Sep 2004
Location: Rome, New York
Distribution: Mandrake 10.0; kernel 2.6.3
Posts: 5

Rep: Reputation: 0
The same way as you edit files as non-root

I use vi editor. You just type:
vi myfile.sh
where myfile.sh is the file you want to edit.

Make sure you check man pages for vi to learn how to navigate while in the editor. Or find a tutorial on the internet on how to use it.
 
Old 09-30-2004, 05:56 PM   #7
pogromca
LQ Newbie
 
Registered: Sep 2004
Location: Rome, New York
Distribution: Mandrake 10.0; kernel 2.6.3
Posts: 5

Rep: Reputation: 0
Talking

Wow.. so many replies within 3 minutes.
 
Old 09-30-2004, 05:58 PM   #8
jjflash53
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
you might even have a tutorial for vi/vim already in your distro, try typing vimtutor at the command prompt, or type mc to see if you have the Midnight Commander file manager.
 
Old 09-30-2004, 06:04 PM   #9
JNaas
Member
 
Registered: Sep 2004
Posts: 43

Original Poster
Rep: Reputation: 15
i tried thi vi thing.... didn't get it??

mc way worked like a charm... guess i got some reading to do!!??

thx guys
 
Old 09-30-2004, 06:33 PM   #10
ehawk
Senior Member
 
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48
vi not for noobs

Do not start with vi. Look at which editors are listed in your GUI selections, try them out as normal user, then run them from the command line after using su to become root

su
[enter root password]
editor_name

I think you would find the editor kate very intuitive if you have it and you have a GUI running.
 
Old 09-30-2004, 07:17 PM   #11
MACSRULE
Member
 
Registered: Apr 2004
Distribution: Gentoo 2004.1
Posts: 56

Rep: Reputation: 15
pico (nano on some machines) is very simple, my personal choice if i don't need the power of emacs
 
  


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
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 12:53 PM
Lilo/kernel question & font question phek Linux - General 9 09-18-2001 12:20 PM

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

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