how to edit a file when not in X (ie from the command line)
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.
how to edit a file when not in X (ie from the command line)
Just wondeing how one can edit a file from the command line,when not in X
I know how to show the contents of the file on the console ( #more filename) but how can I edit and save the changes ?
You need to use a text editor - eg pico /folder/subfolder/filename or vi or whatever your text editor is.
Which file do you need to edit? If it's xf86config to enable your NVidia drivers I found it easier to edit the file first and then to drop into a console to install the driver.
You need to use a text editor - eg pico /folder/subfolder/filename or vi or whatever your text editor is.
That is - type in your text editor name folowed by a space followed by the path to the file you wish to edit. Not knowing your system, distro, etc no one can tell you the exact command.
So your steps are:
Identify which text editor you need to use in a console
Identify the path to your folder and the file name
Type it into a console as "editorname /path/to/filename" (minus the quotes)
Edit the file
Save the file
Typing "man your text editor" (minus the quotes) into a console will give you a great deal of info on th editor and the commands you can use.
Ludwig,I just got my first taste of vi editing fstab so that I could
write to my xp(fat32) partition.
vi <file name>
press ins
edit
esc
shift zz
It took a few trys but I got it done.
acid_kewpie:It's not a question of paying more attention.It's a question of understanding.Things that may seem blindingly obvious to you,might well confuse a newbie like me I'm sorry to be so dumb,but I am new to this and I know my questions must bug some of the more experienced posters here.I can only apologise.
mjolnir: I've also just got the hang of vi.I also have gedit which I can use,I think.
Originally posted by ludwig W Things that may seem blindingly obvious to you,might well confuse a newbie like me. I'm sorry to be so dumb,but I am new to this and I know my questions must bug some of the more experienced posters here.I can only apologise.
Very true. It's easy to get impatient and forget how confusing some of this stuff was, starting out... all of us were newbies at one point.
Don't feel bad about asking questions! I mean, this is LinuxQuestions.org... And the more experienced people might be bugged but that's just too bad for them. Most of the people here are very willing to lend an ear and some assistance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.