Skip to content

本页由 AI 根据韩语原文翻译,可能存在错误。

第1章 终端与 Claude Code ​

必读 想跟着这个阶段学下去,一定要读这一章。

一句话总结:终端是用文字让电脑干活的窗口。本课程会带一个从没打开过终端的人安装 Claude Code,最后做到用一行命令整理每周的笔记。[1]

本课程的运行结果是在 Linux 上得到的。没有在 macOS·Windows 上运行过,这两部分以官方文档为依据。

一开始不需要做到完美。不懂代码也没关系。把你想要的东西用话说清楚就行。[2]

终端是什么 ​

终端(Terminal)是不用鼠标,而是用文字输入命令来操作电脑的窗口。想象一个有光标在闪的黑色(或白色)窗口就行。[3]

平时你是双击文件夹来打开它。在终端里,你要用文字输入"去这个文件夹"。做的事一样,只是方法不同。

在终端里不能点菜单来选择。要用方向键移动。[4] 一开始可能不习惯,但很快就会熟悉。第2章会一步一步学最需要的几个命令。

理解检查

终端是做什么用的窗口?

和聊天有什么不同 ​

如果你用过 Claude 的聊天窗口,应该对这样的顺序很熟悉。复制笔记粘贴进去。拿到回答。再把回答复制到文件里。

Claude Code 是在终端里运行的代理型助手。[5] 代理(Agent)是不只回答,还会自己一步一步把事情做完的程序。交给它一件事,它会收集上下文、采取行动、再确认结果。[6]

把同一件事放在一起比较,就能看出区别。

聊天窗口Claude Code
交给它笔记自己粘贴自己从文件夹里读
结果文字回答回答和文件
收尾我来抄过去Claude 来保存

Claude Code 会自己读需要的文件。[7] 它也能读取并整理已有的文件。[8] 所以你可以这样说。

text
读一下 inbox 里的会议笔记,保存成 minutes.md。回答只要一行。

现在不用输入。第4章再做。

因为它直接处理文件,所以也有需要小心的地方。允许它做什么,后面的章节会详细讲。

理解检查

整理会议笔记时,和聊天窗口相比,Claude Code 最大的不同是什么?

打开你电脑上的终端 ​

终端本来就装在电脑里。不用另外安装。按你的操作系统打开看看。

  • Mac:按 Cmd + Space 打开 Spotlight 搜索。输入 Terminal,按 Enter。[9] 如果系统是中文,也可以输入 终端。
  • Linux:大多数情况下按 Ctrl + Alt + T 就能打开。不行的话,在程序菜单里找"终端"。[10]
  • Windows:按 Win + X,在菜单里选 Windows PowerShell 或 终端(Terminal)。[11]

Windows 有 PowerShell 和 CMD 两种窗口。它们用的命令不同,所以要分清。最前面如果看到 PS C:\ 这样带 PS 的,就是 PowerShell;没有 PS、以 C:\ 开头的,就是 CMD。[12] 本课程里的 Windows 命令都以 PowerShell 为准。

窗口打开了,今天的事就完成了一半。练习结束后,直接关掉窗口也可以。

理解检查

在 Windows 上打开的窗口最前面显示 PS C:\ 这样的字。这是什么窗口?

准备什么 ​

需要三样东西。

  1. 付费账号:免费的 claude.ai 套餐里不包含 Claude Code。[13] 需要有 Pro、Max 这样的付费账号。[14]
  2. 合适的电脑:Mac、Windows、Linux 都可以。操作系统版本和内存要求写在下面的框里。
  3. 网络连接:必须有。[15]
详细说明(点击展开)
  • 可以使用的账号:Pro、Max、Ultra、Team、Enterprise、Console 之一。[14:1]
  • 操作系统:Mac 需要 macOS 13.0 及以上,Windows 需要 Windows 10 1809 及以上。[16] Linux 支持 Ubuntu 20.04 及以上等版本。[17]
  • 内存:需要 4GB 及以上。[15:1]
  • 地区:只能在 Anthropic 支持的国家和地区使用。[18]

练习材料由本课程提供。用虚构的咖啡馆笔记来练习,所以不用担心碰到你自己的文件,可以放心开始。

理解检查

关于使用 Claude Code 需要的账号,下面哪种说法是对的?

本课程要做出什么 ​

本课程有一条主线。就是用一行命令运行的每周整理。

我们用小咖啡馆「街角咖啡馆」员工瑞妍的笔记来练习。把乱糟糟的会议笔记放进文件夹。运行一个脚本(script,按顺序写好命令的文件)。笔记就会一份一份整理成会议记录。

想先看看的话,可以打开完成的脚本和这个脚本做出的会议记录。现在看不懂也没关系。

之所以能这样做,是因为 Claude Code 有一种回答一次就结束的运行方式。[19] 不用来回对话。用一行把要做的事交给它,它回答后就自己结束。这种方式在第10章学。

如果出了问题,脚本能发现这一点。[20] 所以很适合交给它那些不需要人盯着的工作。

课程按这样的顺序进行。

  • 第1~5章:终端基础、安装、第一次会话、输入技巧
  • 第6~9章:继续对话、许可与撤销、项目记忆、技能
  • 第10~13章:自动化、钩子、同时工作、费用与问题解决[21]
  • 第14章:用自己的笔记做每周整理

理解检查

这门课程结束时,你会做出什么?

和应用指南的关系 ​

也有一个桌面应用,给那些不想用终端、想用窗口和按钮的人。[22] 本网站的 Claude Code 应用指南讲的就是这个应用。

看哪一个,可以这样选。

  • 觉得终端有负担:去看应用指南。现在不是非学终端不可。
  • 想用一行命令来跑工作:继续读本课程。

本课程假设你没有读过应用指南。你可以独自跟着学。它和应用指南用的是同样的街角咖啡馆笔记,所以如果你已经读过,内容会觉得眼熟。

理解检查

觉得终端有负担、想用窗口和按钮来操作的人,该怎么办?

动手试试 ​

  1. 用上面的方法打开你电脑上的终端。
  2. 输入下面的命令,按 Enter。
bash
claude --version

会出现两种结果之一。哪一种都没关系。

  • 出现数字,比如 2.1.318 (Claude Code):说明已经装好了。[23] 版本号不同也没关系。
  • 出现 command not found 或 not recognized:意思是还找不到它。[24] 根据界面语言,也可能用中文显示。意思是一样的。第3章会安装。这不是坏了。

问问自己。我电脑上的终端是什么?能回答出 Mac 的终端、Linux 的终端、Windows 的 PowerShell 其中之一就行。

小结 ​

  • 终端是用文字输入命令来操作电脑的窗口。它本来就装在电脑里。
  • Claude Code 是自己读取和创建文件夹里文件的代理型助手。
  • 需要付费账号。免费套餐里没有。
  • Windows 的命令以 PowerShell 为准。确认有没有看到 PS。
  • 本课程的目标是用一行命令运行的每周整理。觉得终端有负担,也可以去看应用指南。

术语整理 ​

术语中文名称一句话解释
Terminal终端用文字输入命令来操作电脑的窗口
PowerShellPowerShellWindows 的终端程序
CMD命令提示符和 PowerShell 命令不同的 Windows 旧式命令窗口
Agent代理自己一步一步把事情做完的程序
Script脚本按顺序写好命令的文件

这一章读完了吗?

学习记录只保存在这个浏览器中。整体进度可以在 全部目录中查看。

下一章:第2章 终端基础

参考资料(24 条)
  1. 本课程依据 2026年11月6日确认的 Claude Code 官方文档编写。运行结果是同一天在 Linux 上用 Claude Code 2.1.318 运行得到的。为了不混入作者的个人设置,运行时关掉了这些设置。没有在 macOS 和 Windows 上运行过。这两部分的内容以官方文档为依据。这段说明在后面的章节里不再重复。没有实际运行过的功能,会在相应位置说明。 ↩︎

  2. Claude Code 官方文档,「Terminal guide for new users」. "You don't need to know how to code." code.claude.com (确认日期 2026-11-06) ↩︎

  3. Claude Code 官方文档,「Terminal guide for new users」. "A window will appear with a blinking cursor. This is your terminal, where you type commands." code.claude.com (确认日期 2026-11-06) ↩︎

  4. Claude Code 官方文档,「Terminal guide for new users」. "You can't click on things in the terminal. Use the arrow keys to move around." code.claude.com (确认日期 2026-11-06) ↩︎

  5. Claude Code 官方文档,「How Claude Code works」. "Claude Code is an agentic assistant that runs in your terminal." code.claude.com (确认日期 2026-11-06) ↩︎

  6. Claude Code 官方文档,「How Claude Code works」. "When you give Claude a task, it works through three phases: gather context, take action, and verify results." code.claude.com (确认日期 2026-11-06) ↩︎

  7. Claude Code 官方文档,「Quickstart」. "Claude Code reads your project files as needed." code.claude.com (确认日期 2026-11-06) ↩︎

  8. Claude Code 官方文档,「Terminal guide for new users」. "Claude can read and organize files you already have:" code.claude.com (确认日期 2026-11-06) ↩︎

  9. Claude Code 官方文档,「Terminal guide for new users」. "Press Cmd + Space to open Spotlight Search, type Terminal, and press Enter." code.claude.com (确认日期 2026-11-06) ↩︎

  10. Claude Code 官方文档,「Terminal guide for new users」. "On most distributions, press Ctrl + Alt + T or search for "Terminal" in your application menu." code.claude.com (确认日期 2026-11-06) ↩︎

  11. Claude Code 官方文档,「Terminal guide for new users」. "Press Win + X and select Windows PowerShell (or Terminal) from the menu." code.claude.com (确认日期 2026-11-06) ↩︎

  12. Claude Code 官方文档,「Quickstart」. "On Windows, your prompt shows PS C:\ when you're in PowerShell and C:\ without the PS when you're in CMD." code.claude.com (确认日期 2026-11-06) ↩︎

  13. Claude Code 官方文档,「Advanced setup」. "The free claude.ai plan does not include Claude Code access." code.claude.com (确认日期 2026-11-06) ↩︎

  14. Claude Code 官方文档,「Advanced setup」. "Claude Code requires a Pro, Max, Ultra, Team, Enterprise, or Console account." code.claude.com (确认日期 2026-11-06) ↩︎

  15. Claude Code 官方文档,「Advanced setup」. "4 GB+ RAM, x64 or ARM64 processor" / "internet connection required" code.claude.com (确认日期 2026-11-06) ↩︎

  16. Claude Code 官方文档,「Advanced setup」. "macOS 13.0+" / "Windows 10 1809+ or Windows Server 2019+" code.claude.com (确认日期 2026-11-06) ↩︎

  17. Claude Code 官方文档,「Advanced setup」. "Ubuntu 20.04+" code.claude.com (确认日期 2026-11-06) ↩︎

  18. Claude Code 官方文档,「Advanced setup」. "Anthropic supported countries" code.claude.com (确认日期 2026-11-06) ↩︎

  19. Claude Code 官方文档,「Quickstart」. "Run one-off query, then exit" code.claude.com (确认日期 2026-11-06) ↩︎

  20. Claude Code 官方文档,「Run Claude Code programmatically」. "Claude Code exits with code 0 on success and a non-zero code when the run fails, so your scripts can branch on the exit status." code.claude.com (确认日期 2026-11-06) ↩︎

  21. 本课程的脚本以 Mac·Linux 的 bash 为准。bash 是 shell(在终端里理解命令的程序)的一种。Mac 的默认 shell 是 zsh,但本课程用 bash 文件名 这样的方式,用 bash 来运行脚本。在 Windows PowerShell 里不能原样运行。Windows 不用保存的文件,而是粘贴整段内容来运行。第10章会再讲一次。 ↩︎

  22. Claude Code 官方文档,「Advanced setup」. "Prefer a graphical interface?" code.claude.com (确认日期 2026-11-06) ↩︎

  23. Claude Code 官方文档,「Advanced setup」. "A working installation prints a version number such as 2.1.211 (Claude Code)." code.claude.com (确认日期 2026-11-06) ↩︎

  24. Claude Code 官方文档,「Troubleshoot installation and login」. "If installation succeeded but you get a command not found or not recognized error when running claude, the install directory isn't in your PATH." code.claude.com (确认日期 2026-11-06) ↩︎