官术网_书友最值得收藏!

1.3 Editing Files

Configuring a Linux system typically involves editing files. For those new to Linux it can be unclear which editor to use. If you are running a terminal session and do not already have a preferred editor we recommend using the nano editor. To launch nano in a terminal window simply enter the following command:

# nano <file>

Where <file> is replaced by the path to the file you wish to edit. For example:

# nano /etc/passwd

Once loaded, nano will appear as illustrated in Figure 1-2:

Figure 1-2

To create a new file simply run nano as follows:

# nano

When you have finished editing the file, type Ctrl-S to save the file followed by Ctrl-X to exit. To open an existing file, use the Ctrl-R keyboard shortcut.

If you prefer to use a graphical editor within the GNOME desktop environment gedit is a useful starting point for basic editing tasks. To launch gedit from the desktop press Alt-F2 to display the Enter a Command window as shown in Figure 1-3:

Figure 1-3

Enter gedit into the text field and press the Enter key. After a short delay, gedit will load ready to open, create and edit files:

Figure 1-4

Alternatively, launch gedit from a terminal window either with or without the path to the file to open:

# gedit

# gedit /etc/passwd

主站蜘蛛池模板: 宣汉县| 蚌埠市| 阿克| 泰和县| 大方县| 巴彦淖尔市| 武清区| 新兴县| 平罗县| 郸城县| 老河口市| 德阳市| 孝感市| 石林| 廊坊市| 万全县| 锡林浩特市| 梅州市| 马尔康县| 沧源| 玛沁县| 鄂温| 织金县| 长丰县| 舒城县| 临朐县| 嫩江县| 嘉定区| 郧西县| 延长县| 百色市| 饶河县| 阿勒泰市| 山阳县| 六盘水市| 新泰市| 抚远县| 宜丰县| 饶阳县| 新野县| 苗栗县|