说明
本文是个人学习用的非官方中英对照译文,原文:https://diveintosystems.org/book/Appendix2/index.html。
原书采用 CC BY-NC-ND 4.0 许可(禁止演绎),请勿公开传播本译文。
标为「译注」「现代更新」的内容是译者补充,不代表原书作者观点;代码与原文逐字一致,未作改动。
17. Appendix 2: Using Unix
本附录概述 Unix 命令行的使用,以及一些有用的 Unix 命令和工具。我们的重点是 Linux,它的命令行界面可以代表更广泛的一类 Unix 操作系统。不同的 Unix 实现之间可能存在细微差别,但我们在这里介绍的内容几乎在所有 Unix 实现中都是相同的。我们的介绍旨在入门,并给出更深入、更进阶内容的参考资料。我们涵盖的主题包括:
This appendix provides an overview of using the Unix command line and some useful Unix commands and utilities. Our focus is on Linux, which is representative of the command line interface to a broader set of Unix operating systems. Different Unix implementations may have subtle differences, but almost all of what we present here is the same across different Unix implementations. Our coverage is meant as an introduction to these topics, providing references to more advanced and in-depth coverage elsewhere. The topics we cover include the following:
- Unix 文件系统与 Unix 命令行的使用(包括命令:
ls、pwd、mkdir、cp、mv、rm、rmdir、cat、echo、wc、touch)。
- The Unix file systems and using the Unix command line (includes commands:
ls,pwd,mkdir,cp,mv,rm,rmdir,cat,echo,wc,touch).
- Unix 手册与阅读 Unix 手册页(
man、apropos)。
- The Unix manual and reading Unix man pages (
man,apropos).
- 远程访问 Unix 系统(
ssh和scp)。
- Remotely accessing Unix systems (
sshandscp).
- Unix 文本编辑器,以及关于学习
vim(和vi)编辑器的一些信息。
- Unix text editors with some information about learning the
vim(andvi) editor.
- 使用
make和编写 Makefile。
- Using
makeand writing Makefiles.
一些进阶的命令行功能和工具,包括:
- 搜索文件和目录:
grep和find。 - 进程控制与运行(
ps、&、fg、bg、CNTRL-Z、kill、history、time)。 - 归档文件(
tar)与文件压缩(gzip、bzip2)。 - 文件权限(
chmod、ls -l)。 - I/O 重定向(
<, 1>, 2>, &>, >>)与管道(|)。 - 点文件、
.bashrc、环境变量 - 编写和使用简单的 Bash shell 脚本。
- 获取系统状态信息的工具(
top、/proc)。
- 搜索文件和目录:
Some advanced command line features and utilities including:
searching files and directories:
grepandfind.process control and running (
ps,&,fg,bg,CNTRL-Z,kill,history,time).archive files (
tar) and file compression (gzip,bzip2).file permissions (
chmod,ls -l).I/O redirection (
<, 1>, 2>, &>, >>) and pipes (|).dot files,
.bashrc, environment variableswriting and using simple Bash shell scripts.
utilities for getting information about the state of the system (
top,/proc).