1.VibeCoding 终端命令基础使用

1.切换目录

bash 复制代码
cd 文件夹名        # 进入当前目录下的某个文件夹
cd ..              # 返回上级目录
cd ~               # 回到用户主目录(Mac/Linux / PowerShell)
cd /               # 回到根目录(Mac/Linux)
cd D:              # Windows 切换盘符(仅 CMD)

示例:

  • Windows CMD:cd C:\Users\你的用户名\Documents
  • Mac/Linux:cd /Users/你的用户名/Documents 或 cd ~/Documents

2.列出当前目录内容 -- ls / dir

系统 命令 说明
Windows (CMD) dir 列出文件和文件夹
Windows (PowerShell) ls 推荐,更接近 Linux
Mac / Linux ls 列出
常用参数(Mac/Linux) ls -l(详细信息) ls -a(包含隐藏文件)

3.创建目录

系统 命令
Windows (CMD) mkdir 文件夹名
Windows (PowerShell) mkdir 文件夹名或 New-Item -ItemType Directory 文件夹名
Mac / Linux mkdir 文件夹名

4.创建空文件

系统 命令
Windows (CMD) del 文件名
Windows (PowerShell) Remove-Item 文件名(也可用 del)
Mac / Linux rm 文件名

5.删除空目录

系统 命令
Windows (CMD) rmdir 文件夹名
Windows (PowerShell) Remove-Item 文件夹名
Mac / Linux rmdir 文件夹名(仅空目录) rm -r 文件夹名(删除目录及其内容,谨慎使用)

6.查看文件内容

系统 命令 说明
Windows (CMD) type 文件名.txt 打印内容到屏幕
Windows (PowerShell) cat 文件名.txt或 Get-Content
Mac / Linux cat 文件名.txt 打印全部内容
Mac / Linux less 文件名.txt 分页浏览(按 q 退出)
Mac / Linux head -n 5 文件名.txt 查看前5行

7.清屏

系统 命令
Windows (CMD) cls
Windows (PowerShell) cls或 Clear-Host
Mac / Linux clear或 Ctrl + L

8.常用快捷键(通用)

快捷键 作用
Tab 自动补全路径/命令(极其常用)
↑/ ↓ 翻阅之前输入过的命令
Ctrl + C 终止当前正在运行的程序(卡住时用)
Ctrl + L 清屏(Mac/Linux 及 PowerShell)
Ctrl + A/ Ctrl + E 光标移到行首 / 行尾
Ctrl + R 搜索历史命令(Mac/Linux)

bash 复制代码
:: 回家(用户根目录)
cd %USERPROFILE%

:: 创建练习文件夹
mkdir claude-practice

:: 进入文件夹
cd claude-practice

:: 创建空文件
type nul > hello.txt

:: 查看目录文件
dir

:: 写入内容到文件
echo Hello Claude > hello.txt

:: 读取文件内容
type hello.txt

:: 返回上级目录
cd ..

:: 删除文件夹(谨慎执行,会直接删除不提示)
rmdir /s /q claude-practice

Mac/Linux 练习

bash 复制代码
cd ~                      # 回家
mkdir claude-practice     # 创建练习文件夹
cd claude-practice        # 进入
touch hello.txt           # 创建文件
ls                        # 看到 hello.txt
echo "Hello Claude" > hello.txt   # 写入内容
cat hello.txt             # 查看内容
cd ..                     # 返回上级
rm -r claude-practice     # 删除练习(谨慎)
操作 Windows (CMD) Mac / Linux
切换目录 cd cd
列出文件 dir ls
创建目录 mkdir mkdir
创建文件 type nul > 文件 touch
删除文件 del rm
查看文件 type cat
清屏 cls clear
自动补全 Tab Tab
历史命令 ↑ ↑
相关推荐
jerrywus16 小时前
Skill、MCP、Workflow、Rules、Memory 有什么区别?拿几次真实开发任务讲清楚
前端·agent·claude
jerrywus2 天前
AI 写的代码能跑,为什么接手的人想跑?
前端·agent·claude
一缕82年的清风2 天前
谷歌突发王炸:Gemini 4 Carbon 登顶全球第一,大模型三强决战彻底变天
gpt·claude·gemini
youcans_2 天前
【嵌入式软件AI编程】22. STM32 基础实验:GPIO外部中断
stm32·单片机·嵌入式硬件·ai编程·claude
Flynt2 天前
AI 写的页面一眼假?有人把"假指纹"写成 62 条规则,不用大模型就能跑
前端·ai编程·claude
jerrywus3 天前
Skill不就是prompt吗?我拿它做了一段南京新街口微缩景观动画
chatgpt·agent·claude
ZzT3 天前
vibe coding 做小游戏·开工篇:5 天、8400 行代码一行没手写,先让 AI 能检查自己
ai编程·游戏开发·claude
一缕82年的清风3 天前
别再手写几千字 Prompt 了:GitHub 狂揽万星的 Agent Skills,宣告了玄学的终结
gpt·chatgpt·claude