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 05-29-2005, 02:07 PM   #1
kos147
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Rep: Reputation: 15
how to perform simple editing of a file


When my machine boots, a list of operating systems is provided and I choose which one I want to use. If I don't select anything then linux loads by default.

I want to change this so that windows loads by default. Through the help of these forums I know I need to change:

/etc/lilo.conf as root

then run

/sbin/lilo to effect the changes.

I was given a link to http://www.linuxcommand.org/ for further info. I have now read this site and it has been an excellect source for getting to know the shell. But it has not provided any info on how to edit a file and save. Could somoene please explain how to do the above steps?

Also what was meant in the above by then run /sbin/lilo to effect the changes.
 
Old 05-29-2005, 02:13 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
For editing a file - see vi:
http://www.collaborium.org/onsite/ve...nux_guides/vi/

For running /sbin/lilo - just type it as a prompt as root and press enter.
 
Old 05-29-2005, 02:18 PM   #3
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
Never used vi but i find emacs pretty good

emacs <path to file> then will open in an editor similar to windows notepad
 
Old 05-29-2005, 02:34 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Or, even easier, try XEmacs if you have it. It's a nice X-windows shell for Emacs, and easier to use for new users. You didn't mention your release, so I can't suggest how you'd get XEmacs. You'd probably do something like "yum install xemacs" or "apt-get xemacs."
 
Old 05-29-2005, 03:22 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by PTrenholme
Or, even easier, try XEmacs if you have it. It's a nice X-windows shell for Emacs, and easier to use for new users. You didn't mention your release, so I can't suggest how you'd get XEmacs. You'd probably do something like "yum install xemacs" or "apt-get xemacs."
Are you aware of the fact that the "normal" emacs has a GUI
frontend, too? No need to install xemacs which exclusively
runs in X ...



Cheers,
Tink
 
Old 05-29-2005, 04:37 PM   #6
naimslim89
Member
 
Registered: Mar 2005
Location: London, United Kingdom
Distribution: Fedora Core 5
Posts: 83

Rep: Reputation: 15
Use vi. Nice, quick and easy. No GUI (X) needed.

To open a file:

$ vi your_file_name

To edit the file: Press I.

Then navigate through the file normally and make any changes.

When complete, press ESC once.

Then, type ":wq" to save and quit.

Done.
 
Old 05-29-2005, 06:53 PM   #7
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Quote:
$ vi your_file_name
To edit the file: Press i.
Then navigate through the file normally and make any changes.
When complete, press ESC once.
That may be oversimplifying it a bit. On any vi I've used, you had to hit ESC everytime you wanted to move to another line ... then i again to edit that line. ... vim works as you describe.

That being said, kos147, ... Do extend the effort to gain at least rudimentary skills with vi ... once you begin to get comfortable with it switch to vim, and don't use the GUI's until you're comfortable using them in the shell. vi is different, but it's not really hard ... and it's ubiquitous on Unix type systems.

If I want to use a GUI editor, I prefer nedit ... but for things like a quick edit of your lilo.conf files, vi is the right tool. A big part of becoming proficient any any endeavor is learning the use of the right tool for the task at hand.

Also, when you're through editing {SHIFT} ZZ works just like :wq ... If you mess it up and want to start over ... :q!

Last edited by rickh; 05-29-2005 at 06:56 PM.
 
Old 05-29-2005, 07:53 PM   #8
kos147
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks for the advice everyone.

I think I will start to learn how to use VI.

In the meantime in order to make the required change is it ok to editi this file using KWrite.

Also could someone give me the command to run lilo and also which dir I should be in.

Thanks
 
Old 05-29-2005, 07:55 PM   #9
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by kos147
Thanks for the advice everyone.

I think I will start to learn how to use VI.

In the meantime in order to make the required change is it ok to editi this file using KWrite.

Also could someone give me the command to run lilo and also which dir I should be in.

Thanks
The command to run lilo is lilo, and can be issued from anywhere
as long as you're root and it's in your path ;)


Cheers,
Tink
 
Old 05-29-2005, 08:14 PM   #10
kos147
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Original Poster
Rep: Reputation: 15
ok tried to use vi to edit the file it says it is a read only file and I need to use ! - what dos this mean?

Also the last post says:

The command to run lilo is lilo, and can be issued from anywhere
as long as you're root and it's in your path

what does this mean - as long as you're root? and its in my path?
 
Old 05-29-2005, 08:31 PM   #11
kos147
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Original Poster
Rep: Reputation: 15
ok using: ls - l lilo.conf

I can see that the root user can read and write.
irm
and the root group can only read.

I assume because I cannot save ny chnages that I am not root user. Is there a way of confirming this?

Also how do I now modify the file?
 
Old 05-29-2005, 08:41 PM   #12
pjbii
Member
 
Registered: Mar 2005
Distribution: FreeBSD, Slack, Fedora3
Posts: 35

Rep: Reputation: 15
pico is easy, nano on some i think
 
Old 05-29-2005, 08:54 PM   #13
JunctaJuvant
Member
 
Registered: May 2003
Location: Wageningen, the Netherlands
Distribution: OS X & Linux Mint
Posts: 488

Rep: Reputation: 31
Quote:
Originally posted by kos147

I assume because I cannot save ny chnages that I am not root user. Is there a way of confirming this?

Also how do I now modify the file?
Type "whoami" on the command line. If it says anything other than "root" (and it probably will), you need to issue the command "su" followed by your root password. Then you may edit lilo.conf in your favorite editor.
 
Old 05-29-2005, 10:53 PM   #14
gnukish
Member
 
Registered: Apr 2005
Location: Neverland
Distribution: Slackware / Ubuntu
Posts: 171

Rep: Reputation: 30
beginner friendly ?? did u say that ?? Vim and Vi are what u said. Emacs is a bit tough to use than vi

Last edited by gnukish; 05-31-2005 at 06:16 AM.
 
Old 05-30-2005, 04:57 AM   #15
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
I always preferred Nano - extremely straightforward, beginner-friendly - but I have started using Vim exclusively, and I think I'll stick with that.
 
  


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
simple image editing MuzikQuest SUSE / openSUSE 3 12-06-2004 11:23 AM
problems creating a simple bootable cd to perform a simple task czarherr Linux - Software 1 11-11-2004 05:22 AM
How to perform a file system check? atheist Linux - General 6 02-29-2004 11:47 AM
GUI test tool to perform widget functions via a text file liguorir Linux - Software 0 01-05-2004 02:30 PM
Simple Image Editing Software?? mike975 Linux - Newbie 4 09-15-2003 04:02 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