LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   need to edit!!! (https://www.linuxquestions.org/questions/linux-newbie-8/need-to-edit-116276/)

scammeh^ 11-15-2003 05:52 AM

need to edit!!!
 
what is the command in linux to edit or view a conf file?
Im running Mandrake Network Firewall and since it doesnt have a direct GUI interface i need the commands for the shell to edit shorewall and squid which it runs.

Can any1 help?

:p

comawhite 11-15-2003 05:55 AM

Well, you have a lot of different editors which you can use like vi, vim, emacs and so on, but if you are new to linux i would recommend to use pico or nano (not standards in most systems) but install one of them and then type nano/pico <the file you want to edit> and voilá!

Note: I dont know if this is the answer you are looking for but i wish u good luck!

scammeh^ 11-15-2003 05:59 AM

cheers
 
Thanks! I will =]

because its MNF i dont think you can install any new editors, but im sure vim or something will do!!

Thanks for your help,

scammeh^

Nimoy 11-15-2003 07:14 AM

You could also check if mc is installed - (Midnight Commander) - try typing mc at the prompt, F3 to edit files...

wahwah 11-15-2003 06:14 PM

Hi,

you could try vi. It's on every system. It can be a bit tedious to use at first, but if you get it 'in your fingers' it's really a very useful editor.
Very very very short tutorial:
open a file
vi <filename> (if it doesn't exist, it's created now) <enter>
scroll through the file with either the arrow keys or with the h-j-k-l keys (left-down-up-right).
To insert text, type i (INSERT appears on the bottom line)
To delete text (one char at a time), you can use DEL on most systems, either in INSERT mode or noet inINSERT mode ... to stop editing, press ESC.
To save the file type (not in INSERT mode!)
:wq! (the : gives you a command prompt on the bottom line)
To exit without changing the file enter
:q!
Help with:
:help



To view a file you can use LESS.
less <filename><enter>
Scroll through the text with arrow keys or PGUP/PGDWN keys.
Exit with:
:q

Hope this helps.
There is also a more extensive builtin tutorial in vi. It takes about 30 min to complete and teaches you some more tricks (like search/replace and the like). You can enter this tutor in the help file:
:help
in the help file, scroll down until you find the tutor tag [tutor];
place your cursor on it and press ctrl-]

scammeh^ 11-16-2003 07:27 AM

wow thanks!! :D

exactly what i need!

cheers guys!


All times are GMT -5. The time now is 01:12 AM.