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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
05-29-2005, 02:07 PM
|
#1
|
LQ Newbie
Registered: Aug 2004
Posts: 27
Rep:
|
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.
|
|
|
05-29-2005, 02:13 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
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.
|
|
|
05-29-2005, 02:18 PM
|
#3
|
Senior Member
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522
Rep:
|
Never used vi but i find emacs pretty good
emacs <path to file> then will open in an editor similar to windows notepad
|
|
|
05-29-2005, 02:34 PM
|
#4
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
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."
|
|
|
05-29-2005, 03:22 PM
|
#5
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
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
|
|
|
05-29-2005, 04:37 PM
|
#6
|
Member
Registered: Mar 2005
Location: London, United Kingdom
Distribution: Fedora Core 5
Posts: 83
Rep:
|
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.
|
|
|
05-29-2005, 06:53 PM
|
#7
|
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:
|
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.
|
|
|
05-29-2005, 07:53 PM
|
#8
|
LQ Newbie
Registered: Aug 2004
Posts: 27
Original Poster
Rep:
|
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
|
|
|
05-29-2005, 07:55 PM
|
#9
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
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
|
|
|
05-29-2005, 08:14 PM
|
#10
|
LQ Newbie
Registered: Aug 2004
Posts: 27
Original Poster
Rep:
|
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?
|
|
|
05-29-2005, 08:31 PM
|
#11
|
LQ Newbie
Registered: Aug 2004
Posts: 27
Original Poster
Rep:
|
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?
|
|
|
05-29-2005, 08:41 PM
|
#12
|
Member
Registered: Mar 2005
Distribution: FreeBSD, Slack, Fedora3
Posts: 35
Rep:
|
pico is easy, nano on some i think
|
|
|
05-29-2005, 08:54 PM
|
#13
|
Member
Registered: May 2003
Location: Wageningen, the Netherlands
Distribution: OS X & Linux Mint
Posts: 488
Rep:
|
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.
|
|
|
05-29-2005, 10:53 PM
|
#14
|
Member
Registered: Apr 2005
Location: Neverland
Distribution: Slackware / Ubuntu
Posts: 171
Rep:
|
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.
|
|
|
05-30-2005, 04:57 AM
|
#15
|
Member
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879
Rep:
|
I always preferred Nano - extremely straightforward, beginner-friendly - but I have started using Vim exclusively, and I think I'll stick with that.
|
|
|
All times are GMT -5. The time now is 10:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|