每天看點英文文檔:APUE第三版(1)

      網友投稿 982 2022-05-29

      @[toc]

      前言

      這本書好厚啊,一千多頁。

      為什么會想看一本英文著作呢?

      我想,不久后的將來,我會感謝現在自己的所作所為的,就像我依舊每天堅持鍛煉一樣。分開之后,我更加的透徹了,有些事情,要為自己而做。學習嘛,學給自己的;鍛煉身體嘛,也是為了自己的未來,找到心儀對象的時候,不至于被嫌棄小肚男,虛胖等。

      (其實是昨晚突然想通了,自己的能力上去了,兩三千只不過是一周不到的工資而已,而且只是起步階段。為什么要耽誤了自己的前程呢?20-30歲,多投資自己。)

      想明白這些之后,我就更加堅定了不再水文的信念了。順便早上花半個小時和以前的放縱說了聲再見(一口氣清理了二十篇水文),以此明志!!!

      為什么會選APUE呢?

      可以說目前還是要強迫自己去看英文文檔的,那為什么不挑一份自己喜歡的呢?

      就像我當時,腦子一抽風就翻譯了redis的配置文件一樣,現在仍然為當初的“一時沖動”感到自豪、

      寫這么個專欄的目的是什么呢?

      那當然不是為了傳授什么知識了,反正都要翻譯的,放在這里對我還能起一個正向促進的作用。==順便看看能帶動一個朋友算一個吧==(要是被帶動了可以在評論區跟我說一聲兒哦,要是人多我就組個社群,大家一起學會比較有動力,雖然我已經建了四五個社群了,但是英語社群還沒試過)。

      1、UNIX System Over view:Unix系統簡介

      1.1 Introduction

      All operating systems provide services for programs they run. Typical services include a new program, opening a file, reading a file, allocating a region of memory, getting the current time of day, and so on. The focus of this text is to describe the services provided by various versions of the UNIX operating system.

      Describing the UNIX System in a strictly linear fashion, without any forward references to terms that haven’t been described yet, is nearly impossible (and would probably be boring). This chapter provides a whirlwind tour of the UNIX System from a programmer ’s perspective. We’ll give some brief descriptions and examples of terms and concepts that appear throughout the text. We describe these features in much more detail in later chapters. This chapter also provides an introduction to and overview of the services provided by the UNIX System for programmers new to this environment.

      所有的操作系統都有提供程序運行的服務,這些服務包括:執行一個新的程序、打開一個文件、讀取一個文件、分配一塊內存、獲取當前日期等。本文檔的目的是講述各版本的Unix系統所提供的服務。

      如果不建立在對以往Unix系統有所了解的基礎上,想要講明白Unix系統,幾乎是不可能的,或者,將會很枯燥。本章將從程序員的角度出發,快速瀏覽Unix系統。我們會使用一些貫穿全文的簡單術語,我們將會在后文中介紹這些術語。本章還介紹并概述了UNIX系統為不熟悉此環境的程序員提供的服務。

      1.2 UNIX Architecture(UNIX體系結構)

      In a strict sense, an operating system can be defined as the software that controls the hardware resources of the computer and provides an environment under which programs can run. Generally, we call this software the kernel, since it is relatively small and resides at the core of the environment. Figure 1.1 shows a diagram of the UNIX System architecture.

      什么是操作系統?嚴格意義上來說,操作系統屬于軟件范疇,它提供了對底層計算機資源的調度以及對任何程序都能運行的環境。

      由于它小的很,且處于環境的核心部位,所以我們通常稱之為內核。看下面的示意圖:

      The interface to the kernel is a layer of software called the system calls (the shaded portion in Figure 1.1). Libraries of common functions are built on top of the system callinterface, but applications are free to use both. (We talk more about system calls and library functions in Section 1.11.) The shell is a special application that provides an interface for running other applications.

      In a broad sense, an operating system consists of the kernel and all the other software that makes a computer useful and gives the computer its personality. This other software includes system utilities, applications, shells, libraries of common functions, and so on.

      For example, Linux is the kernel used by the GNU operating system. Some people refer to this combination as the GNU/Linux operating system, but it is more commonly referred to as simply Linux. Although this usage may not be correct in a strict sense, it is understandable, given the dual meaning of the phrase operating system. (It also has the advantage of being more succinct.)

      內核的接口是一層被稱之為系統調用的軟件(如果覺得別扭,請調整一下你對軟件的定義),庫函數(或者函數庫)構建在系統調用之上,好在這它倆都是開放使用的。shell則是一種比較特殊的為其他應用運行提供接口的應用。

      廣義上來說,操作系統應該包含內核以及其它所有使得電腦能夠被更簡便操作的軟件,其他軟件包括系統實用程序、應用程序、shell、常用函數庫等。

      例如:Linux的內核使用的操作系統就是GNU,有些人稱這種組合為 GNU/Linux,不過更常見的說法叫就是簡易Linux系統,雖然這種說法可能不太準確,但是從“操作系統”的雙重含義上來說,也是可以理解的了。

      1.3 Logging In

      When we log in to a UNIX system, we enter our login name, followed by our password. The system then looks up our login name in its password file, usually the file

      /etc/passwd

      If we look at our entry in the password file, we see that it’s composed of seven colon-separated fields: the login name, encrypted password, numeric user ID(205), numeric group ID (105),acomment field, home directory (/home/sar), and shell

      program (/bin/ksh).

      sar:x:205:105:Stephen Rago:/home/sar:/bin/ksh

      All contemporary systems have moved the encrypted password to a different file. In Chapter 6, we’ll look at these files and some functions to access them.

      當我們登錄UNIX系統時,我們需要先輸入我們的賬號,緊接著就是我們的密碼,此后操作系統就會和預留在系統內的密碼文件進行匹配,通常是這個文件:/etc/passwd。

      如果我們進入到這個文件進行查看的時候,我們會看到這個文件的七個組成部分如下:登錄名、加密過的密碼、用戶ID(數字)、用戶組ID(數字)

      賬戶領域、home目錄,以及shell程序,例如:sar:x:205:105:Stephen Rago:/home/sar:/bin/ksh

      所有當代系統都已將加密密碼移動到另一個文件中。在第6章中,我們將介紹這些文件以及訪問它們的一些函數。

      Once we log in, some system information messages are typically displayed, and then we can type commands to the shell program. (Some systems start a window management program when you log in, but you generally end up with a shell running in one of the windows.) A shell is a command-line interpreter that reads user input and executes commands. The user input to a shell is normally from the terminal (an interactive shell) or sometimes from a file (called a shell script). The common shells in use are summarized in Figure 1.2.

      登錄之后,系統會顯示一下系統信息,之后我們可以在shell命令行中輸入我們的指令。shell是用于接收用戶指令并運行的命令行接口,用戶可以在終端操作shell,或通過文件的形式。下面總結了常用的shell:

      The system knows which shell to execute for us based on the final field in our entry in the password file.

      (此處省略一批對各種shell的歷史來源等介紹)

      The default shell used by different Linux distributions varies. Some distributions use the Bourne-again shell. Others use the BSD replacement for the Bourne shell, called dash (Debian Almquist shell, originally written by Kenneth Almquist and later ported to Linux). The default user shell in FreeBSD is derived from the Almquist shell. The default shell in Mac OS X is the Bourne-again shell. Solaris, having its heritage in both BSD and System V, provides all the shells shown in Figure 1.2.

      Throughout the text, we will use parenthetical notes such as this to describe historical notes and to compare different implementations of the UNIX System. Often the reason for a particular implementation technique becomes clear when the historical reasons are described.

      Throughout this text, we’ll show interactive shell examples to execute a program that we’ve developed. These examples use features common to the Bourne shell, the Korn shell, and the Bourne-again shell.

      系統根據密碼文件中的最后一組數據來判斷要給我們提供哪種類型的shell服務。

      不同版本的Linux使用的默認shell各不相同,有些發行版再次使用Bourne shell。其他人使用BSD替代Bourne shell,稱為dash(Debian Almquist shell,最初由Kenneth Almquist編寫,后來移植到Linux)。FreeBSD中的默認用戶shell派生自Almquist shell。MacOSX中的默認shell是Bourne shell。Solaris繼承了BSD和SystemV的傳統,提供了圖1.2所示的所有shell。

      每天看點英文文檔:APUE第三版(1)

      TCP/IP

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:SpringBoot系列:SpringBoot第十二篇:springboot集成apidoc
      下一篇:Java項目構建基礎:將日志形式,異常處理,結果返回形式統一起來
      相關文章
      噜噜综合亚洲AV中文无码| 久久夜色精品国产嚕嚕亚洲av| 亚洲五月综合缴情在线观看| 韩国亚洲伊人久久综合影院| 亚洲av无码专区在线观看下载| 亚洲国产成人手机在线电影bd | 在线亚洲97se亚洲综合在线| 国产精品亚洲专区无码唯爱网| 亚洲乱码国产乱码精华| 亚洲最大中文字幕无码网站| 国内精品久久久久影院亚洲| 亚洲一级特黄特黄的大片 | 亚洲中文字幕无码专区| 亚洲欧洲精品成人久久曰影片 | 1区1区3区4区产品亚洲| 亚洲视频一区在线观看| 亚洲国产精品综合久久2007| 亚洲午夜精品在线| 亚洲一区二区三区乱码在线欧洲| 久久亚洲国产最新网站| 亚洲日本在线电影| 亚洲av无码片vr一区二区三区| 爱情岛论坛亚洲品质自拍视频网站| 亚洲精品无码久久久久秋霞| 爱情岛论坛亚洲品质自拍视频网站 | 亚洲av午夜成人片精品网站| 亚洲av成人无码久久精品 | 亚洲人成人无码网www电影首页 | 亚洲精品国产电影午夜| 久久国产亚洲高清观看| 2022年亚洲午夜一区二区福利 | 亚洲精品福利网泷泽萝拉| 91情国产l精品国产亚洲区 | 亚洲欧美日韩中文字幕一区二区三区| 亚洲日本人成中文字幕| 亚洲日韩久久综合中文字幕| 国产成人综合亚洲| 亚洲日韩精品一区二区三区| 亚洲夜夜欢A∨一区二区三区| 国产亚洲真人做受在线观看| 九月丁香婷婷亚洲综合色|