一、Shell 提示符默认 shell 为 bash默认bash shell提示符是$图形界面需打开终端。man 命令查手册man -k搜关键词q退出Tab 键自动补全。二、浏览文件系统单一根目录//分隔路径无盘符磁盘通过挂载点接入目录树。关键目录/home用户目录、/root管理员目录、/var日志、/tmp临时文件、/media/mnt外设挂载点。路径绝对路径从 / 开始、相对路径.当前、..上级。三、文件和目录列表pwd查看当前目录cd切换目录。ls列文件-l看权限详情、-a显示隐藏文件、-R递归、-F区分目录 / 文件支持* ? [] !通配符过滤。四、文件 / 目录管理创建touch建空文件mkdir -p创建多级目录。复制cp -i、移动重命名mv -i-i覆盖前提醒。删除rm删文件rmdir仅删空目录rm -rf强制递归删目录高危。链接ln硬链接同 inodeln -s软链接快捷方式。五、处理文件file判断文件类型。cat全量输出more/less分页浏览less 可上下翻。head -n看前 N 行tail -n看末尾 N 行tail -f实时监控日志。创建项目结构pwdmkdir -p ~/LearningNotes/{lectures,references,backups}cd ~/LearningNotes/lecturespwd创建和编辑笔记pwd# 创建两个空文件touch linux_basics.txt commands_cheatsheet.txt# 写入linux_basics.txt内容cat linux_basics.txt EOFLinux Command Basicscd: Change directoryls: List files and directoriespwd: Print working directorycat: Display entire filehead: Show first 10 linestail: Show last 10 linesless: Interactive file viewerEOF# 写入commands_cheatsheet.txt内容cat commands_cheatsheet.txt EOFcat: Display entire filehead: Show first 10 linestail: Show last 10 linesless: Interactive file viewerEOF文件操作pwd# 复制并重命名cp commands_cheatsheet.txt ../references/command_reference.txt# 重命名文件mv linux_basics.txt linux_fundamentals.txt# 创建备份文件cp linux_fundamentals.txt ../backups/# 更新时间戳touch commands_cheatsheet.txt查看和分析文件内容pwd# 查看完整内容cat linux_fundamentals.txt# 查看前两行head -n 2 ../references/command_reference.txt# 查看后三行tail -n 3 commands_cheatsheet.txt# 交互式浏览less ../references/command_reference.txt项目维护pwd# 切换到项目根目录cd ~/LearningNotespwd# 列出完整目录结构tree# 删除文件rm references/command_reference.txt# 创建空文件touch project_status.txt# 更新所有文件访问时间touch lectures/* references/* backups/* project_status.txt最终项目结构LearningNotes/├── backups/│ └── linux_fundamentals.txt├── lectures/│ ├── commands_cheatsheet.txt│ └── linux_fundamentals.txt├── references/└── project_status.txt