溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

UNIX/Linux 系統(tǒng)管理技術(shù)手冊(cè)閱讀(三)

發(fā)布時(shí)間:2020-02-25 21:54:12 來(lái)源:網(wǎng)絡(luò) 閱讀:371 作者:cix123 欄目:系統(tǒng)運(yùn)維

2016.8.12 23:20-23:50

1.2 SUGGESTED BACKGROUND

1.2 讀者的知識(shí)背景

  We assume in this book that you have a certain amount of Linux or UNIX experience. In particular, you should have a general concept of how the system looks and feels from the user’s perspective since we don’t review this material. Several good books can get you up to speed; see the reading list on page 27.

  本書(shū)假定讀者已經(jīng)具備一定程序的Linux或者UNIX經(jīng)驗(yàn)。尤其要從用戶的角度對(duì)系統(tǒng)的風(fēng)格有個(gè)一般性的概念,因?yàn)槲覀儾辉購(gòu)?fù)核這方面的材料。有一些優(yōu)秀的書(shū)籍可以幫助讀者迅速掌握這些概念,請(qǐng)看第27頁(yè)。

  Even in these days of Compiz-powered 3D desktops, the GUI tools for system administration on UNIX and Linux systems remain fairly simplified in comparison with the richness of the underlying software. In the real world, we still administer by editing configuration files and writing scripts, so you’ll need to be comfortable with both a command-line shell and a text editor.

  即便在現(xiàn)今有三維圖形顯示功能的桌面計(jì)算機(jī)上,用于UNIX和Linux系統(tǒng)管理的GUI工具與其下層豐富的軟件相比,依然顯得相當(dāng)簡(jiǎn)單。在現(xiàn)實(shí)世界里,我們?nèi)匀灰ㄟ^(guò)編輯配置文件和編寫腳本來(lái)完成管理工作,因此讀者需要習(xí)慣于使用某種命令行的shell和某種文本編輯器。

  Your editor can be a GUI tool like gedit or a command-line tool such as vi or emacs. Word processors such as Microsoft Word and OpenOffice Writer are quite different from text editors and are nearly useless for administrative tasks. Command-line tools have an edge because they can run over simple SSH connections and on ailing systems that won’t boot; there’s no need for a window system. They are also much faster for the quick little edits that administrators often make.

  編輯器可以像gedit那樣的GUI工具,也可以是像vi或emacs那樣的命令行工具。像Microsoft Word和OpenOffice這樣的字處理程序和廣本編輯器差別很大,對(duì)于系統(tǒng)管理工作幾乎沒(méi)有什么用處。命令行工具有個(gè)優(yōu)勢(shì),因?yàn)樗鼈兛梢酝ㄟ^(guò)一條SSH連接運(yùn)行,還可以在出問(wèn)題不能啟動(dòng)的系統(tǒng)上使用;而且不需要用圖形窗口系統(tǒng)。對(duì)于系統(tǒng)管理員常做的微小編輯工作來(lái)說(shuō),它們的運(yùn)行速度也快很多。

  We recommend learning vi (now seen most commonly in its rewritten form, vim), which is standard on all UNIX and Linux systems. Although it may appear a bit pallid when compared with glitzier offerings such as emacs, it is powerful and complete. GNU’s nano is a simple and low-impact “starter editor” that has on-screen prompts. Be wary of nonstandard editors, though; if you become addicted to one, you may soon tire of dragging it along with you to install on every new system.

  我們推薦讀者學(xué)會(huì)使用vi(現(xiàn)在最常見(jiàn)的是它的一種經(jīng)過(guò)重寫的形式,即vim)它是所有UNIX和Linux系統(tǒng)上的標(biāo)準(zhǔn)軟件。盡管同emasc這樣的華麗軟件相比,vi可能顯得有些平淡,但vi的功能還是非常強(qiáng)大和完善的。GNU的nano是一種簡(jiǎn)單、易上手的“入門編輯器”,它有屏幕提示功能。選用非標(biāo)準(zhǔn)的編輯器則要小心,如果讀者已經(jīng)對(duì)這樣的一種編輯器“上了癮”,那么很快就會(huì)對(duì)它感到厭煩,因?yàn)樾枰阉鼛У缴磉叄员阍诿總€(gè)新系統(tǒng)上都要安裝一次。


2016.8.13 23:00-23:40

  One of the mainstays of administration (and a theme that runs throughout this book) is the use of scripts to automate administrative tasks. To be an effective administrator, you must be able to read and modify Perl and bash/sh scripts.

  系統(tǒng)管理工作的主要支柱之一(并且也是貫穿本書(shū)的一個(gè)主題),是使用腳本來(lái)自動(dòng)完成管理任務(wù)。更成為一名高效率的系統(tǒng)管理員,必須能夠閱讀并修改Perl和bash/sh腳本。

  For new scripting projects, we recommend Perl or Python. As a programming language, Perl is admittedly a bit strange. However, it does include many features that are indispensable for administrators. The O’Reilly book Programming Perl by Larry Wall et al. is the standard text; it’s also a model of good technical writing. A full citation is given on page 27.

  對(duì)于編寫新腳本,我們推薦使用Perl或者Python。作為一種編程語(yǔ)言,Perl有些奇怪,不過(guò)它確實(shí)包含了許多對(duì)管理員來(lái)說(shuō)不可少的特性。由O'Reilly出版、Larry Wall等編寫的Programming Perl一書(shū)是Perl的標(biāo)準(zhǔn)教程,該書(shū)是技術(shù)圖書(shū)的典范,本書(shū)27頁(yè)給出了更完整的信息。

  Many administrators prefer Python to Perl, and we know of sites that are making a concerted effort to convert. Python is a more elegant language, and Python scripts are generally more readable and easier to maintain. (As Amazon’s Steve Yegge said, “The Python community has long been the refuge for folks who finally took the red pill and woke up from the Perl Matrix.”) A useful set of links that compare Python to other scripting languages (including Perl) can be found at python.org/doc/Comparisons.html.

  許多系統(tǒng)管理員更愿意用Python而不是Perl,而且我們也知道有些地方正在一起努力從Perl轉(zhuǎn)向Python。Python是一種比Perl更優(yōu)美的語(yǔ)言,而且Python腳本往往可讀性更好,也更容易維護(hù)(正如亞馬遜公司的Steve Yegge所說(shuō),“長(zhǎng)久以來(lái),Python社區(qū)都是從Perl陣營(yíng)逃出來(lái)的人的庇護(hù)所,這些人吞下紅色的藥丸,從Perl的Matrix里蘇醒過(guò)來(lái)”)。從python.org/doc/Comparisons.html可以找到一組有用的鏈接,把Ptyhon同其他腳本語(yǔ)言(包含Perl)進(jìn)行一番比較。

  Ruby is an up-and-coming language that maintains many of the strengths of Perl while avoiding some of Perl’s syntactic pitfalls and adding modern object-oriented features. It doesn’t yet have a strong tradition as a scripting language for system administrators, but that will likely change over the next few years.

  Ruby是一款正處于上升期的語(yǔ)言,它保留了Perl的許多強(qiáng)大功能,又避免了Peral的一些語(yǔ)法缺陷,還增加了現(xiàn)代的面向?qū)ο筇匦?。它作為系統(tǒng)管理員的一款腳本語(yǔ)言,其根基還不深,但在未來(lái)幾年內(nèi),這種情況可能會(huì)有所改變。

  We also suggest that you learn expect, which is not a programming language so much as a front end for driving interactive programs. It’s an efficient glue technology that can replace some complex scripting. expect is easy to learn.

   我們還推薦讀者學(xué)會(huì)expect。它與其說(shuō)是一款編程語(yǔ)言,倒不如說(shuō)是用于驅(qū)動(dòng)交互式程序執(zhí)行的前端語(yǔ)言。它是一款高效的“膠水”語(yǔ)言,能夠替代一些復(fù)雜的腳本編程,expect腳本學(xué)起來(lái)很容易。

  Chapter 2, Scripting and the Shell, summarizes the most important things to know about scripting for bash, Perl, and Python. It also reviews regular expressions (text matching patterns) and some shell idioms that are useful for sysadmins.

  本書(shū)的第2章總結(jié)了有關(guān)bash、Perl和Python腳本編程最重要的知識(shí)。這一章還復(fù)習(xí)了正則表達(dá)式(文本匹配模式)和一些shell的慣用法,它們對(duì)用系統(tǒng)管理工作來(lái)說(shuō)很有用。


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI