Linux - NewbieThis 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.
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.
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.
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!
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-]
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.