第 1 章命令行操作及常用命令使用...........................................................................................5
1.1 命令行操作 ...................................................................................................................5
1.1.1 Shell 简介...........................................................................................................5
1.1.2 Shell 控制台使用方法..........................................................................................6
1.2 常用命令使用................................................................................................................6
1.2.1 登录和退出 Linux 系统.........................................................................................6
1.2.2 文件和目录操作命令 ............................................................................................8
1.2.3 用户及用户组管理命令 ......................................................................................10
1.2.4 进程及任务管理命令 ..........................................................................................13
1.2.5 磁盘及文件系统管理命令 ...................................................................................16
1.2.6 软件安装命令 ....................................................................................................17
第 2 章文件查看/编辑方法介绍...............................................................................................19
2.1 cat 命令介绍...............................................................................................................19
2.2 vi 命令介绍.................................................................................................................19
2.2.1 vi 的进入与退出.................................................................................................20
2.2.2 vi 中显示行号....................................................................................................20
2.2.3 光标移动操作 ....................................................................................................21
2.2.4 文本插入操作 ....................................................................................................22
2.2.5 文本修改操作 ....................................................................................................23
2.2.6 文本搜索与替换操作 ..........................................................................................25
2.3 head 及tail 命令介绍...................................................................................................26
第 3 章网络配置及操作..........................................................................................................27
3.1 网络配置命令..............................................................................................................27
3.1.1 ifconfig .............................................................................................................27
3.1.2 route................................................................................................................28
3.2 网络操作命令..............................................................................................................30
3.2.1 netstat..............................................................................................................30
3.2.2 nslookup ..........................................................................................................31
3.2.3 host .................................................................................................................32
3.2.4 finger ...............................................................................................................32
3.2.5 Ping 命令..........................................................................................................33
3.3 常用网络配置文件介绍 ................................................................................................33
3.3.1 /etc/sysconfig/network 网络设置.........................................................................34
3.3.2 /etc/hosts IP 地址和主机名的映射.......................................................................34
3.3.3 /etc/services.....................................................................................................35
Linux 操作指导专题 文档密级 内部公开
2004-02-04 华为 3Com 机密未经许可不得扩散第4页, 共53页
3.3.4 /etc/host.conf 配置名字解析器............................................................................35
3.3.5 /etc/nsswitch.conf 配置名字解析器.....................................................................36
3.3.6 /etc/resolv.conf 配置DNS 客户..........................................................................37
3.3.7 /etc/xinetd.conf .................................................................................................37
3.3.8 /etc/modules.conf 文件......................................................................................39
3.3.9 /etc/sysconfig/network-scripts/ifcfg-ethN 文件.....................................................39
3.4 常用网络操作方法 .......................................................................................................39
3.4.1 ftp 远程文件传输...............................................................................................40
3.4.2 telnet................................................................................................................42
3.4.3 r-系列命令........................................................................................................43
第 4 章常用使用技巧..............................................................................................................45
4.1 Linux 下软件包的安装及卸载........................................................................................45
4.1.1 RPM 安装操作..................................................................................................45
4.1.2 RPM 查询操作..................................................................................................45
4.1.3 RPM 卸载操作..................................................................................................46
4.1.4 RPM 升级操作..................................................................................................46
4.1.5 RPM 验证操作..................................................................................................46
4.1.6 RPM 的其他附加命令........................................................................................47
4.2 Linux 操作系统的时钟系统...........................................................................................47
4.2.1 时钟系统介绍 ....................................................................................................47
4.2.2 硬件时钟系统与系统时间的同步 .........................................................................47
4.3 系统信息及运行状态监控 .............................................................................................48
4.3.1 df 命令..............................................................................................................49
4.3.2 du 命令.............................................................................................................49
4.3.3 top 命令............................................................................................................49
4.3.4 iostat 命令........................................................................................................50
4.4 打包/压缩工具tar ........................................................................................................50
4.5 文件及文件内容的查找 ................................................................................................51
4.5.1 文件查找命令 find..............................................................................................51
4.5.2 文件内容查找命令 grep......................................................................................51
4.6 Linux 的系统服务及其配置...........................................................................................52
4.6.1 服务简介 ..........................................................................................................52
4.6.2 启动和停止服务 ................................................................................................52
4.6.3 服务的添加 删除自动运行及状态..................................................................53