It would be very nice indeed if all people knew how to use the "vi" text editor. http://www.cis.ksu.edu/~bhoward/vi/ But in Debian you don't actually need "vi" because the basic installation of Debian comes also with another text editor, "nano", that is even nicer than "vi" because it has in-built instructions how to use it. What would you do if you hadn't used computer for some time and had forgot the basic commands of "vi"? OK, you can always type "man vi" and spend some time re-learning "vi". But, if you're in a hurry, you just need to remember the name of that other text editor in Debian, "nano", and that is enough. "nano" itself tells you how to use it. :)
But if you get a fancy to install some flavour of *BSD, for instance, it's good to know how to edit files with "vi" because, unlike "nano", "vi" is available in ALL Unix-like systems. So, macondo's basic tutorial on how to edit files with "vi" is very useful indeed -- even if you prefer to use "nano" after all. ;) |
I use vi (or vim) every single day. It's so easy, especially when you do quick editing. It doesn't take very long to get used to and I don't have to open a gui window ;)
All you really have to know. i - to insert text o - to open a new line below the current one to insert text. ESC - to get back to command mode u - to undo yy - to copy current line yw - to copy current word p - to paste after cursor P - to paste before cursor :w to save :wq to save and exit 0 - to go to begnning of currenet line $ - to go to end of current line w - to go to next word G - to go to end of file 1G - to go to first line in file. ctrl+b - to bo back one screen ctrl-f - to go forward one screen It seems like it would be hard to learn but once you try, it is easy. And then later you learn that replacing text is much easier with a sed script :) I work on a lot of servers where there is no gui and no nano, etc. So you HAVE to know vi. And it does pay to know ;) |
Thank you Darthtux and Dead Parrot. That was pretty good, and yet nobody has explained Nano, which is used by many people, i just wanted to cover that so newbies could start somewhere
Let's say i want to edit a file: #nano /etc/modules once there, do i need to change modes? if so, what's the key combo? once the file is edited, how do i get out of there, save and exit? That's all. |
2 or 3 things I would like tom see added to the Config post Install doco
"apt-get install nano" for an easy to use text editor One thing that's missing (for me anyway) is automatic updating via cron of your Debian system a la Windows Update and then email the results of the process to another account. When installed to the hard disk Knoppix automatically does this but Debian Sarge doesn't. "apt-get update" to refresh your packages list "apt-get upgrade' to fetch and install new packages and security fixes I don't know how to automate this process via a CRON job and I don't know how to send the results via email. There is thread here http://www.linuxquestions.org/questi...light=cron+apt that sort of shows how to apt-get via cron but no email notifications. Anybody ? |
Quote:
-i autoindent -c display cursor position at bottom of screen -m enable mouse to select text Nano doesn't have "modes" like vi. Nano has its key combinations at the bottom of the screen. The ^ character stands for the control key. The most important is ^G which gives all the shorcuts and their meaning. There are several Meta(Alt) key combinations which switch certain features on and off. To see them ^G. To save ^O and save the file name and ^X to exit. |
Quote:
To get the script to run weekly (exactly what time and day doesn't matter for me) I simply place the script in /etc/cron.weekly/ The e-mail notification is in the script itself with the follwing command: Code:
echo "blah blah blah" | mail -s "some subject" user_to_be_emailed Hope this helps, /TLV |
"To save ^O and save the file name and ^X to exit."
OK, i edited a file, did: Ctrl+O Ctrl+X the last command did not work, i finally closed it, and checked back and the changes were not implemented, what did i do wrong? |
When you do ^O look at the bottom of the screen. It says "File Name to Write:" . You have to name it and press ENTER. Or if you opened a file, it will put its name there and you just press ENTER. Then you press ^X. If you just pressed ^X, It said "Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES)". You have to press "Y" to get back to the File Name to Write:" to enter a file name.
|
Thanks a lot Darthtux, it worked like a charm! Learned one more thing today. :)
|
Automatic updates are accomplished via the cron-apt tool.
apt-get install cron-apt Then read the man page. Default configuration is to download only, but you CAN change this to download and install. HTH |
Wow! you guys have saved me hours of :study: and made this :newbie: install much easier. Answered a lot of :Pengy: I didn't even know I should ask!
|
Automatic Shutdown
This is a problem that has been bugging me for a couple of years. Every time i install a distro, i can't shut it down completely, it usually works half of the time, except with Libranet, it's the only distro that shuts it down completely ALL the time.
I've spent hours (literally) searching Google and forums all over the net, the debian-user-mailing lists in english, portuguese, spanish and italian, plus, the IRC debian channels, #linuxhelp, and every geek i casually meet. The problem is my motherboard, it's an Intel 440something and the BIOS is circa 1998, it has never been flashed, i bought this box (PII 266) second hand. I have tried everything under the sun and nothing. I have used different commands to shut it down: shutdown -h now poweroff halt -p different lines on the kernel stanza in the grub/menu.lst and /etc/modules: apm=on apm=off apm=power-off apm power_off=1 noapic acpi=off At best it would shut down 70 percent of the time. It would just give this message at the end: Flushing IDE devices: hda hdb hdc hdd Power down until now... I suspect there is a ton of people with the same problem out there, there is no guarantee this will work for you, it worked for me, i'm a happy camper. :D It was accidental, really. Last weekend i was bored. I decided to wipe the my hard drive clean and install Sarge with pre-rc2 debian-installer, i was using sid at the time. I inserted the cd and went thru every option they had, by pressing the Fn keys, looking at everything, something i had neglected before. I knew i did not want the 2.6 kernel on my decrepit box, i wanted to make a newbie installation just to see how the other half lives; so at the boot prompt, i ended up with: linux noapic nolapic noframebuffer (i can't remember the full string for it) and away i went, after installing the basics, apmd (new trick) icewm i tried to shut it down, with: #shutdown -h now and it shut down completely the first time, no less. I tried 6 times, and it never failed. Then i installed Blackbox, it shutdown too, perfect (5 times), it's been a week now, and it hasn't let me down. I just wanted to share this, in case there is some people in the same boat. Edit: a week later i reinstalled (surprise) and this time installed Sarge with the kernel 2.6, no problem, so now i use kernel 2.6.8 for the first time. |
Re: Automatic Shutdown
Quote:
Not sure why it messed up the complete halt of a system. /TLV |
TLV said:
"And I'm pretty sure this is the one that did it for you." Boy, i'm glad this is over. BTW, today WindowMaker came out with its latest version 0.90.0 http://www.windowmaker.org/ Dead Parrot must be jumping up and down. :) |
Quote:
Window Maker 0.91.0 is now in unstable. :) To make fonts look good you need to turn on antialiasing in WPrefs.app (select "Smooth font edges"). |
All times are GMT -5. The time now is 07:56 PM. |