Linux 命令行与 shell 脚本编程大全 第 3 章:Bash shell 基础命令
3.1 启动 shell Starting the Shell
3.2 使用 shell 提示符 Using the Shell Prompt
3.3 与 bash 手册交互 Interacting with the Bash Manual
3.4 浏览文件系统 Navigating the Filesystem
3.4.1 Linux 文件系统 Looking at the Linux filesystem
3.4.2 遍历目录 Traversing directories
cd destination # change directory 目录切换
1. 绝对路径 Using absolute directory references
[root@localhost ~]$ pwd # print working directory (absolute path) 输出当前工作目录
/root
2. 相对路径 Using relative directory references
输入:
[root@localhost ~]$ cd / # change directory
[root@localhost ~]$ cd .. # parent directory (one level up from the current directory)
输出:
[root@localhost /]$
输入:
[root@localhost /]$ cd ~ # home directory
[root@localhost /]$ cd - # previous directory
输出:
[root@localhost ~]$
输入:
[root@localhost ~]$ cd /
3.5 列出文件和目录 Listing Files and Directories
3.5.1 显示基本列表 Displaying a basic listing
[root@localhost /]$ ls # list
[root@localhost /]$ ls . # current directory
输出:
Hello World!
3.5.2 显示长列表 Displaying a long listing
3.5.3 过滤输出列表 Filtering listing output
3.6 处理文件 Handling Files
3.6.1 创建文件 Creating files
3.6.2 复制文件 Copying files
3.6.3 使用命令行补全 Using command-line completion
3.6.4 链接文件 Linking files
3.6.5 文件重命名 Renaming files
3.6.6 删除文件 Deleting files
3.7 管理目录 Managing Directories
3.7.1 创建目录 Creating directories
3.7.2 删除目录 Deleting directories
3.8 查看文件内容 Viewing File Contents
3.8.1 查看文件类型 Viewing the file type
3.8.2 查看整个文件 Viewing the whole file
3.8.3 查看部分文件 Viewing parts of a file
3.9 小结 Summary