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

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

主站蜘蛛池模板: 东乌珠穆沁旗| 高雄县| 开封市| 筠连县| 特克斯县| 连江县| 三门峡市| 伊吾县| 新蔡县| 洪雅县| 全州县| 拉孜县| 巫溪县| 临高县| 米易县| 巴中市| 武邑县| 杨浦区| 安溪县| 黄山市| 周至县| 高阳县| 镇康县| 景洪市| 界首市| 盐亭县| 光山县| 昌吉市| 池州市| 三亚市| 黄大仙区| 庄浪县| 汝阳县| 抚宁县| 湖北省| 沙河市| 江口县| 和硕县| 祁东县| 清流县| 四子王旗|