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. |
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. |
Never used vi but i find emacs pretty good
emacs <path to file> then will open in an editor similar to windows notepad |
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."
|
Quote:
frontend, too? No need to install xemacs which exclusively runs in X ... Cheers, Tink |
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. |
Quote:
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! |
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 |
Quote:
as long as you're root and it's in your path ;) Cheers, Tink |
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? |
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? |
pico is easy, nano on some i think
|
Quote:
|
beginner friendly ?? did u say that ?? Vim and Vi are what u said. Emacs is a bit tough to use than vi
|
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 05:33 AM. |