APUE 全称: Advanced Programming in the Unix Environment.

  参考书籍为人民邮电出版社出版的Advanced Programming in the Unix Environment英文版第二版,笔记先列英文原文,下面是自己翻译版,由于英文水平问题,错误的地方还望大家指正,自己的总结就没有英文原版拉。

  1 UNIX System Overview (Unix 系统概述)

  1.1 Introduction (介绍)

  All operationg systems provide services for programs they run. (所有的操作系统为它们所允许的程序提供服务。)

  1.2 UNIX Architecture (Unix 架构)

  In a strict sence, 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. (严格来说,操作系统被定义为控制计算机的硬件资源的软件和为程序提供允许的环境。)

  In a borad sense, an operating system is the kernel and all the other software that makes a computer useful and gives the computer its personality.(宽泛的说, 操作系统是“核心” 和其它一些软件,它们使得计算机非常有用的和个性话的。)

  1.3 Logging in (登录)

  Login name (登录名)

  The /etc/passwd file:

 

  yanjf: the login name (登录名: 惟一; 大小写是敏感; “*” 表示该账号被查封了,系统不允许持有该账号的用户登录)

  x: encrypted password (加密密码:用一个“x”来代替,将/etc /shadow作为真正的口令文件)

  1000: numeric user ID (用户ID:数值;在某些特定目的下,系统中可以存在多个拥有不同注册名、但UID相同的用户,事实上,这些用户是同一个用户)

  1000: numeric group ID (用户组ID:数值;每个用户可以同时属于多个组;在/etc/group文件中指明一个组所包含用户)

  yanjf,,,: a command field (注释字段:包含有关用户的一些信息,如用户的真实姓名、办公室地址、联系电话,mail和finger等程序利用这些信息来标识系统的用户)

  /home/yanjf: home directory (主目录:超级用户root的主目录为/root;而其它个人用户在/home目录下均有自己独立的工作环境)

  /bin/bash: shell program (默认shell脚本)

  Shells

  A shell is a command-line interpreter that read users input and executes commands.(shell 是一个命令行解释器,它读取用户输入并且执行命令。)

Name Path
Bourne shell  /bin/sh
Bourne-again shell /bin/bash
C shell /bin/csh
Korn shell /bin/ksh
TENEX C shell /bin/tcsh

  1.4 Files and Directories (文件和目录)

  File System (文件系统)

  The UNIX file system is a hierarchical arrangement of directories and files. (UNIX 文件系统是按层次组织的目录和文件。)

  A directory is a file that contains directory entries. (目录是一个包含目录条目的文件。)

  We can think of each directory entry as containing a filename along with a structure of information describing the attributes of the file.(我们可以认为每个目录条目是包含一个文件名和一个描述文件属性的结构体。)

  Filename

  The names in a directory are called filenames. (目录下的名称称为文件名。)

  The only two characters that cannot appear in a filenames are the slash character(/) and the null character. (只有 “/” 和 null 不能出现在文件名中。)

  / 分隔路径中的文件名。null 终止路径。

  Two filenames are automatically created whenever a new directory is created: . and .. 。Dot refers to the current directory, and dot-dot refers to the parent directory.(新建目录是自动创建 "."  和 ".." 两个文件名。“.”指向当前目录,“..”指向父目录)

  In the root directory , dot-dot is the same as dot. (在根目录下,"." 和 “..” 指向同一个目录。)

  Today, almost all commercial UNIX file system support at least 255-character filenames. (当今,几乎所有的商用Unix文件系统都支持至少255个字符的文件名。)

  Pathname (路径名)

  A sequence of one or more filenames, separated by slashes and optionally starting with a slash, forms a pathname. (由/开头或者由/分隔的文件名组成路径。)

  A pathname that begins with a slash is called an absolute pathname; otherwise, it's called a relative pathname. (/开头的路径称为绝对路径,否则为相对路径。)

  Working Directory (工作目录)

  Every process has a working directory, sometimes called the current working directory. (每个进程都有一个工作目录,有时称为当前工作目录。)

  Home Directory (主目录)

  When we log in, the working direcotry is set to our home directory. (登录后工作目录默认为我们的主目录。)

  1.5 Input and Output (输入和输出)

  File Descriptors (文件描述符)

  Standard Input, Standard Output, and Standard Error (标准输入,标准输出,标准错误输出)

  Redirected (>) (重定向) : ls > file.list

  Unbuffered I/O (无缓冲 I/O)

  Unbuffered I/O is provided by the functions open, read, write, lseek, and close.

  Standard I/O (标准 I/O)

  The standard I/O functions provides a buffered interface to the unbuffered I/O functions. (标准I/O函数为无缓冲I/O函数提供拉一个缓冲接口。)

  1.6 Programs and Processes (程序和进程)

  Program (程序)

  A programs is an executable file residing on disk in a directory. (程序是记录在硬盘上的一个目录中的可执行文件。)

  Processes and Process ID (进程和进程ID)

  An executing instance of a program is called a process. (一个程序执行时的实例称为进程。)

  The UNIX System guarantees that ervery process has a unique numeric identifier called the process ID. (Unix 系统确保每个进程有一个唯一的数值标识称为进程ID(非负整数).)

  Process Control (进程控制)

  There are three primary functions for process control: fork, exec, and waitpid. (三个主要的进程控制函数:fork,exec, waitpid。)

  Threads and Thread IDs (线程和线程ID)

  All the threads within a process share the same address space, file descriptors, stacks, and process-related attributes. (所有在同一个进程内的线程共享相同的地址空间,文件描述符,栈,和进程相关的属性。)

  1.7 Error Handing (错误处理)

  When an error occurs in one of the Unix System functions, a negative value is often returned, and the integer errno is usually set to a value that gives additional information. (当Unix系统函数发生错误时,经常会返回一个负数,同时errno这个整数会被设置为一个值,来提供额外的信息。)

  Error Recovery (错误恢复)

  A fatal error hao no recovery action. (致命的错误没有恢复动作。)

  Nonfatal errors, on the other hand, can sometimes bu dealt with more robustly. (另一方面,非致命性的错误可以处理的更健壮。)

  1.8 User Identification (用户标识)

  User ID (用户ID)

  The user ID from our entry in the password file is a numeric value that identifies us to the system. (passwd文件中的用户ID是一个数值作为我们的系统标识)

  We call the user whose user ID is 0 either root or superuser. (用户ID为0的称为root 或者 superuser。)

  Group ID (用户组ID)

  Our entry in the password file alse specifies our numberic group ID. (我们的passwd文件也指定啦我们的用户组ID。)

  There is also a group file that maps group names into numeric group IDs. (有一个组文件来匹配组名和用户组ID。)

  The /etc/group file:

  

  组名:口令:组标识号:组内用户列表

  we call the functions getuid and getgid to return the user ID and the group ID. (我们使用 getuidgetgid 函数返回用户ID和组ID。)

  1.9 Signals (信号)

  Signals are a technique used to notify a process that some condition has occurred. (信号是一种用来通知进程某些条件发生的技术。)

  1.10 Time Values (时间值)

  Calendar time: This value counts the number of seconds since the Epoch: 00:00:00 January 1, 1970, Coordinated Universal Time(UTC). timt_t holds these time values.

  Process time: This is also called CPU time and measures the central processor resources used by a process. (测量进程所使用的中央处理器资源)clock_t holds these time values.

  Clock time: sometimes called wall clock time is the amount of time the process takes to run. (进程允许的时间量。)

  User CPU time: the CPU time attributed to user instructions. (执行用户指令的时间)

  System CPU time: the CPU time attributed to the kernel when it executes on behalf of the process. (进程占用内核的时间。)

  1.11 System Calls and Library Functions (系统调用和库函数)

  All implementations of the UNIX System provide a well-defined, limited number of entry points directly into the kernel called system calls. (Unix 系统的实现都提供一个明确的,有限的指向核心的入口点,称为”system calls“。)

  The technique used on UNIX systems is for each system call to have a function of the same name in the standard C library. (每个系统调用在标准C库函数有一个同名的函数。)

  An application can call either a system call or a library routine. Also realize that many library routines invoke a system call. (应用程序可以调用系统调用和库例程,另外,许多库例程调用啦系统调用。)

  1.12 Summary (总结)

  This chapter has been a short tour of the UNIX System. (这章简单的了解拉下Unix系统。)

  The next chapter is about standardization of the UNIX System and the effect of work in this area on current systems. (下章是关于Unix 系统标准化和当前系统在这方面的影响。)  

  (完)

转载于:https://www.cnblogs.com/yanjf/p/3321956.html

APUE学习笔记之UNIX系统概述(1)相关推荐

  1. APUE 学习笔记(一) Unix基础知识

    1. Unix 体系结构 内核的接口被称为系统调用 公用函数库构建在系统调用接口之上 应用软件既可以调用公用函数库,也可以直接进行系统调用 2. 文件和目录 目录操作函数:opendir---> ...

  2. apue学习笔记(第三章 文件I/O)

    本章开始讨论UNIX系统,先说明可用的文件I/O函数---打开文件.读写文件等 UNIX系统中的大多数文件I/O只需用到5个函数:open.read.write.lseek以及close open函数 ...

  3. APUE学习笔记:第五章 标准I/O库

    5.1 引言 标准I/O库处理很多细节,例如缓冲区分配,以优化长度执行I/O等.这些处理不必担心如何使用正确的块长度.这使得它便于用户使用,但是如果不较深入地了解I/O库函数的操作,也会带来一些问题 ...

  4. APUE学习笔记-11.5线程终止

    2019独角兽企业重金招聘Python工程师标准>>> <312>获得线程退出状态 #include "myapue.h" #include < ...

  5. APUE学习笔记——第十章信号中10.15节例程的运行结果与书本里的不一样

    1.程序 #include "apue.h" #include <setjmp.h> #include <time.h> static sigjmp_buf ...

  6. APUE 学习笔记(十) 高级I/O

    1. Unix IPC(InterProcess Communication) 同一主机的各个进程间的IPC:管道.FIFO.消息队列.信号量.共享存储器 不同主机上的各个进程间IPC:socket套 ...

  7. APUE 学习笔记(三) 文件和目录

    1. 文件类型 文件类型信息包含在 struct stat 里的 st_mode 成员 (1)普通文件,unix内核并不区分文本文件和二进制文件 (2)目录文件,这种文件包含了其他文件的名字以及指向这 ...

  8. APUE 学习笔记 - Chapter 6. System Data File and Infomation

    1.密码文件           每个系统都会有一个文件统一记录用户名与密码,通常是/etc/passwd. 关于这个文件有:                 root 的 uin 通常为 0 . 文 ...

  9. mysql数据库管理系统的配置文件是_MySQL学习笔记_1_MySQL数据库管理系统概述

    1. MySQL架构 C/S: client / server架构 MySQL DBMS(Data Bank Management System): 数据库管理系统 客户端  服务器 --->  ...

最新文章

  1. 4月书讯(下)| 美亚4.8星评,又一本口碑相传的著作来了
  2. 字节码分析finally块对return返回值的影响
  3. java并发编程之美-阅读记录6
  4. mysql 列合并_实战讲解MySQL执行计划,面试官当场“要了我”
  5. [LAMP]——mod_security和mod_evasive模块的安装
  6. logstash收集nginx日志
  7. json对象的封装与解析
  8. fastboot烧写命令
  9. powerdesigner数据字典导出模板设置
  10. Ubuntu LogViewer调试工具
  11. Oracle VM VirtualBox 使用教程,说实话也就那样吧
  12. 18、【易混淆概念集】第十一章2 实施定量风险分析 模拟、敏感性分析、决策树分析 风险应对策略 消极/威胁应对策略 积极/机会风险应对策略 开拓和提高的区别
  13. Python爬虫入门教程:豆瓣Top电影爬取
  14. Windows环境下32位汇编语言程序设计(典藏版) 高清完整
  15. JAXB JavaBean与Xml之间转换
  16. Pikachu靶场全关攻略(超详细!)
  17. Clearing the Skies: A deep network architecture for single-image rain removal解读
  18. crc可以检出奇数个错误_CRC码检错能力的一个问题
  19. memset, fill 对bool,int 赋值的效率
  20. oracle创建表空间、临时表空间

热门文章

  1. CONTEST1001 题解
  2. node的包管理工具:yarn和npm
  3. 排序算法----快速排序(数组形式)
  4. Entityframework Code First 系列之项目搭建
  5. MySQL批量插入数据的几种方法
  6. jquery中的DOM操作集锦
  7. AI - 深度学习之美十四章-概念摘要(8~14)
  8. 深入理解DOM事件机制
  9. 分离解析DNS服务器
  10. cookie设置httponly属性防护XSS***