English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In Ubuntu Linux I was trying to install a graphics card driver, when I accidentally killed my GUI. Now I need to edit a text file using only the command line. I have no GUI, so text editors are out. How can I do this?

2006-08-24 11:57:02 · 2 answers · asked by Kyle 3 in Computers & Internet Programming & Design

2 answers

Try the following commands until you find one that works:

nano filename
pico filename
joe filename

You must be in the directory that contains the filename or you must supply the full path to the file for the filename argument.

2006-08-24 12:01:45 · answer #1 · answered by reason1000 3 · 1 0

Hi, if you a running LINUX, and don't have access to a GUI for some reason, you should consider using the vi editor. just type vi on the command line or vim if you version of LINUX has vim. vi or vim are not the same as using note pad on windows. You are going to need some instructions.

to start inserting text, you must press i on the keyboard.Then you can start typing. Once you finished typing, you can press the escape key.

To move around in the file you don't normally use the arrow keys, instead you will use the following:

j moves cursor down
k moves cursor up
h moves cursor left
l moves cursor right
Note that to move, you must be out of the insert mode. If you are unsure, just press the escape key.


to move multiple times just type
5J which means move down 5 times
5k which means move up 5 times

so remember, before you can type any text, first type i, which will get you into the text insertion mode. Then start typing.

If you want to delete, come out of insert mode, by pressing the escape key, the go to what you want to delete, then type x as many times as you want to delete.

go to this link

http://www.chem.brown.edu/instructions/vi.html

don't worry, you will get used to it

2006-08-24 12:20:10 · answer #2 · answered by M M 1 · 1 0

fedest.com, questions and answers