Software, settings, next steps · 软件、设置与下一步
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
English
Installing software
- On Linux you rarely download installers. A package manager fetches and installs software for you.
- Debian and Ubuntu use
apt; Fedora usesdnf; macOS users often addbrew:
- One command, and the tool (and anything it needs) is installed and ready.
中文
安装软件
- 在 Linux 上,你很少需要下载安装程序。包管理器会替你获取并安装软件。
- Debian 和 Ubuntu 用
apt;Fedora 用dnf;macOS 用户常常会装一个brew:
sudo apt update
sudo apt install git
- 一条命令,这个工具(以及它所需要的一切)就装好待用了。
Explore · 探索
Installing with a package manager · 用包管理器安装软件
apt update refreshes the catalogue, apt install fetches the tool and its needs. · apt update 刷新软件目录,apt install 取来工具和它的依赖。
English
The environment
- The shell remembers settings in environment variables. The most important is
PATH— the list of folders it searches for commands. - Your personal settings live in a file called
.bashrcin your home folder. Editing it lets you create shortcuts (aliases) and change how the shell behaves.
中文
环境
- shell 把各种设置记在环境变量里。其中最重要的是
PATH—— 它列出 shell 查找命令时要搜索的文件夹。 - 你的个人设置保存在主目录下一个叫
.bashrc的文件里。编辑它,你就能创建快捷方式(别名),并改变 shell 的行为。
English
Where to go next
- You now know how to navigate, read, search, combine, and manage files — the core of the command line.
- Keep a real terminal open and use it for small tasks; speed comes with habit.
- Next steps: learn
gitfor version control, a text editor likenanoorvim, and a little shell scripting to automate your favourite commands. Well done!
中文
下一步去哪儿
- 现在你已经会浏览、读取、搜索、组合和管理文件了 —— 这正是命令行的核心。
- 让一个真实的终端常开着,用它来处理小任务;熟能生巧,速度自然就来了。
- 接下来可以学:用于版本控制的
git、像nano或vim这样的文本编辑器,以及一点shell 脚本,把你常用的命令自动化。做得好!
English
Now you try
aptneeds the real internet, so it is not in our simulator — but a list of installed packages is saved ininstalled.txt.- Use the tools from this course to
sortthe list andwcto count it. The same handful of commands work on any text data.
中文
现在你来试
apt需要真实的网络,所以不在我们的模拟器里 —— 但一份已安装软件包的清单保存在installed.txt里。- 用本课学到的工具
sort给清单排序,用wc数一数数量。同样这几条命令对任何文本数据都管用。
English
Common mistakes
- Read a command's
--helpormanpage before using unfamiliar options. - Test a risky command on a copy of your files first.
中文
常见错误
- 使用不熟悉的选项前,先读命令的
--help或man手册。 - 危险的命令先在文件副本上测试。
apt list --installed is a real command, not part of our simulator — but here its output is saved in installed.txt. Put the package names in alphabetical order with sort installed.txt. · apt list --installed 是一条真实命令,不在我们的模拟器里 —— 但它的输出已保存在 installed.txt 里。用 sort installed.txt 把包名按字母顺序排列。
How many packages are installed? Count the lines with cat installed.txt | wc -l — the same file tools work on any data. · 装了多少个包?用 cat installed.txt | wc -l 数一数行数 —— 同样的文件工具对任何数据都管用。