Skip to content

Moving around

Linux & the command line Lesson 2 2:08 English narration · English + 中文 subtitles burned in

space play · ←/→ 5s · j/l 10s · f fullscreen · ,/. speed

Chapters

Transcript
Folders — Linux calls them directories — hold files and other folders, and the whole lot is one tree. 文件夹——Linux 叫它们目录——装着文件和其他文件夹,而这一整套是一棵树。
A single slash at the top is the root, and there is nothing above it. 最顶上一个斜杠是根,而它上面什么都没有。
Somewhere inside is your own folder, your home, written as a tilde. 在某个地方是你自己的文件夹,你的家目录,写作一个波浪号。
And the indentation here is what inside looks like: work is inside documents, which is inside student. 而这里的缩进就是"在里面"的样子: work 在 documents 里面,documents 在 student 里面。
Two commands do the walking. 有两条命令负责走路。
You start at home. 你从家目录开始。
Type l s and the shell lists what is here — documents and hello dot t x t. 敲 ls,shell 列出这里有什么——documents 和 hello.txt。
Type c d documents and now you are inside it: the tree has not changed, you have moved. 敲 cd documents,现在你就在它里面了: 树没有变,是你移动了。
Not sure where you ended up? 不确定自己走到哪里了?
Check with p w d, any time. 随时用 pwd 查一下。
Three shortcuts will save you more typing than anything else in this course. 有三个快捷写法,能替你省下比这门课里任何东西都多的敲字。
C d dot dot goes up one level, to the parent folder. cd .. 上一层,回到父目录。
C d on its own, or c d tilde, takes you straight back home from anywhere. 单独一个 cd,或者 cd ~,从任何地方直接把你带回家目录。
And c d minus takes you back to where you just were, which is perfect for hopping between two folders. 而 cd - 把你带回你刚才所在的地方, 在两个文件夹之间来回跳的时候特别好用。
A path can be written two ways, and one character tells them apart. 路径有两种写法,而一个字符就能把它们区分开。
Documents slash work is relative: it means "from where I am standing now". documents/work 是相对路径:意思是"从我现在站的地方算起"。
A path that starts at the root, with a leading slash, is absolute: it means the same thing from anywhere on the machine. 而一条以斜杠开头、从根开始的路径是绝对路径: 在这台机器上的任何地方,它的意思都一样。
A relative path means something different depending on where you stand; an absolute one never does. 相对路径的含义取决于你站在哪里;绝对路径永远不会。
Four things to take with you. 带走四点。
One: the filesystem is one tree, rooted at a slash. 第一:文件系统是一棵树,根是一个斜杠。
Two: l s lists this folder and c d moves you into one. 第二:ls 列出当前文件夹,cd 让你进入某一个。
Three: c d dot dot goes up, and c d on its own goes home. 第三:cd .. 向上,而单独的 cd 回家。
Four: a path starting with a slash is absolute. 第四:以斜杠开头的路径是绝对路径。
Now type the tasks into the terminal below. 现在把下面那些题目敲进终端里。

Log in or create account

IGCSE, A-Level & AP