Unix 起源与核心原则 | AI生成和翻译

Home 2026.03

Unix 是一个 multitaskingmulti-user 操作系统家族,最初于 1960 年代末和 1970 年代初开发。它深刻影响了现代计算,是 Linux、macOS、BSD 变体以及众多企业系统的基石。

Unix 简史

核心哲学 (Unix Philosophy)

Unix 系统遵循一套至今仍有影响的设计原则:

Unix 系统的核心组件

  1. Kernel
    操作系统的核心。管理:
    • 进程调度
    • 内存管理
    • 设备驱动
    • 文件系统
    • 系统调用
  2. Shell
    命令行解释器,读取用户输入并执行命令。流行 shell:
    • sh(Bourne shell —— 原始版)
    • bash(Bourne-Again SHell —— 最常见)
    • zsh(功能丰富,现代 macOS 默认)
    • fishkshcshtcsh
  3. File System Hierarchy(主要由 Filesystem Hierarchy Standard —— FHS 标准化)
    • / — 根目录
    • /bin/usr/bin — 基本及标准用户命令
    • /sbin/usr/sbin — 系统管理命令
    • /etc — 配置文件
    • /home — 用户主目录
    • /var — 可变数据(日志、邮件、假脱机)
    • /tmp — 临时文件
    • /dev — 设备文件
    • /proc — 虚拟文件系统,包含进程及内核信息(Linux)
  4. Programs / Utilities
    数千个小型工具:lscatgrepawksedfindsortwc 等。

Unix 的关键特性

Essential Unix Commands (Beginner Survival Kit)

Category Commands Purpose / Common Usage
Navigation pwdcdls -latree 打印当前工作目录、更改目录、列出文件
File ops cpmvrmmkdirrmdir 复制、移动/重命名、删除、创建/删除目录
Viewing/Editing catlessmorenanovim 显示、分页、简单/完整编辑器
Text processing grepsedawkcutsortuniqwc 搜索、替换、处理列、排序、计数
Permissions chmodchownumask 更改模式/所有者、设置默认权限
Processes pstop/htopkilljobsfgbg 列出进程、监控、终止、作业控制
System info uname -adf -hdu -shfree -hwhoamiuptime 内核信息、磁盘使用、内存、身份、上线时间
Finding findlocatewhichwhereis 搜索文件、快速数据库搜索、定位可执行文件
Archiving targzipgunzipzipunzip 打包及压缩文件
Networking pingsshscpcurlwget 测试连通性、远程登录/复制、下载

快速实用示例

# List all files (including hidden) in long format
ls -la

# Create directory structure
mkdir -p project/src docs

# Find all .txt files and count lines in them
find . -name "*.txt" -exec wc -l {} \;

# Monitor processes and sort by CPU usage
top

# Copy directory recursively and preserve permissions
cp -a source/ destination/

# Search for "error" in last 100 lines of log (live follow)
tail -n 100 -f /var/log/syslog | grep error

现代背景 (2026)

如今大多数人使用 Unix-like 系统而非认证 Unix:

学习 Unix 基础意味着掌握直接适用于 Linux、macOS 终端、WSL、容器(Docker)、云服务器(AWS、GCP、Azure)和 DevOps 工作流的技能。

参考文献:


Back Donate