背景:
閱讀英文原作只為了更好地理解書中的精髓褂删,當(dāng)然也是為了更好地掌握書中的技巧屯阀。我們會(huì)堅(jiān)持閱讀全書难衰,并記錄書中的精髓盖袭。
1. 理解 Linux 的 “自由”
Many people speak of "freedom" with regard to Linux. Freedom is the power to decide what your computer does and the only way to have this freedom is to know what your computer is doing. Freedom is a computer that is without any secrets, one where everything can be known if you care enough to find it.
很多人一說到Linux, 就會(huì)說自由鳄虱。但是你真的而理解這種自由嗎柏靶?這種自由是一種權(quán)力悠栓,能夠決定你的計(jì)算機(jī)干什么,獲取這種自由的唯一方式就是知道你的計(jì)算機(jī)在做什么笙瑟。自由就是你的計(jì)算機(jī)沒有任何秘?癞志,你可以從計(jì)算機(jī)那里了解一切往枷,只要你用心去尋找。
2. 什么是 shell
We speak of the command line, we are really referring to the shell. The shell is a program that takes keyboard commands and passes them to the operating system to carry out.
一說起命令行错洁,我們真正指的是 shell戒突。shell 就是一個(gè)程序屯碴,把鍵盤的輸入傳遞給操作系統(tǒng)去執(zhí)行。
3. 初次相遇 shell
第一次見到 shell,你只會(huì)看到一行提示符膊存,形如:[me@linuxbox ~]$
This is called a shell prompt and it will appear whenever the shell is ready to accept input.
這叫做 shell 提示符导而, 無論何時(shí)當(dāng) shell 準(zhǔn)備好接受輸入時(shí),就會(huì)閑這樣的提示符隔崎。當(dāng)然今艺,出現(xiàn)的形式會(huì)根據(jù)不同的 Linux 發(fā)行版有所不同。但是大體上會(huì)包含 主機(jī)名
用戶名
當(dāng)前目錄
和一個(gè)美元符號(hào)
虚缎。
??另外,如果提示符最后是 # 號(hào)千康,而不是 $,會(huì)表示這是一個(gè)具有 super root 權(quán)限的終端。
3. 一些簡(jiǎn)單入門的小命令
命令歷史:使用 ?? 箭頭可以瀏覽以往的命令,以往的命令會(huì)重新出現(xiàn)在提示符后面携栋。
移動(dòng)光標(biāo):使用 ?? ?? 箭頭可以移動(dòng)光標(biāo)搭盾,來更好地編輯命令。
時(shí)間:date 顯示系統(tǒng)當(dāng)前時(shí)間和日期
[me@linuxbox ~]$ date
Sun Sep 30 10:02:00 CST 2018
日歷:cal 與上一個(gè)命令相關(guān)鸯隅,默認(rèn)顯示當(dāng)前月份的日歷蝌以。
[me@linuxbox ~]$ cal
September 2018
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
查看磁盤剩余空間:df
[me@linuxbox ~]$ df
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk1s1 489620264 166659552 315340480 35% 945005 9223372036853830802 0% /
devfs 385 385 0 100% 666 0 100% /dev
/dev/disk1s4 489620264 6291496 315340480 2% 3 9223372036854775804 0% /private/var/vm
map -hosts 0 0 0 100% 0 0 100% /net
map auto_home 0 0 0 100% 0 0 100% /home
/dev/disk2s1 5859376 378616 5480760 7% 2830 4294964449 0% /Volumes/ACDSee
/dev/disk3s2 310480 283440 27040 92% 255 4294967024 0% /Volumes/Charles Proxy v4.2.7
ximi:~ taoshilei$
結(jié)束終端會(huì)話:exit
Note: Don't be tempted to use Ctrl-c and Ctrl-v to perform copy and paste inside a terminal window. They don't work.
提示:不要在終端窗口使用 Ctrl-c 和Ctrl-v 來完成復(fù)制和粘貼工作。這些不起作用何之。這兩個(gè)命令有別的含義跟畅,他們?cè)缬谠谖④浿熬鸵呀?jīng)定義了這兩個(gè)命令的含義,所以不是我們?cè)趙indows下熟悉的復(fù)制粘貼溶推。