shell学习笔记(原书摘录)
来源:互联网 发布:linux 查看机器配置 编辑:程序博客网 时间:2024/06/11 18:30
最近在看UNIX® Shells by Example Fourth Edition,一些知识要点,原文摘录,看了这些,让自己对shell的理解不断的上升、深入,希望能有时间再多看一遍。
利用两天时间看了chapter1、2、3,感觉收获很大。不过接下去的grep sed awk才是shell的精华啊。一天一章节,现在记录一些疑惑粗浅的知识,希望能在第二遍阅读的时候,整理出完好的笔记。
再次推荐阅读这本shell的书籍,附件中有下载。
1、shell is a special program, but what is the pid?
2、pstree: displays all processes as a tree with its root being the first processess that runs ,called init.
3、system calls: is a request for kernel services and is the only way a process can access the system's hardware.
4、To remove zombie processes, the system must be rebooted.
5、fork:The kernel loads this new program into memory in place of the shell that called it. The child shell, then, is overlaid with the new program.
6、在终端上敲下命令ls的shell过程:
For example, if the command ls had been typed at the command line, the parent shell wouldfork a child process and go to sleep. The child shell would thenexec (overlay) thels program in its place. Thels program would run in place of the child, inheriting all the environment variables, open files, user information, and state information. When the new process finished execution, it would exit and the parent shell would wake up. A prompt would appear on the screen, and the shell would wait for another command. If you are interested in knowing how a command exited, each shell has a special built-in variable that contains the exit status of the last command that terminated.
7、on bash shell , a command exec success($? = 0) failed($? = 1)
8、The EUID and EGID determine what permissions a process has access to when reading, writing, or executing files. If the EUID of a process and the real UID of the owner of the file are the same, the process has the owner's access permissions for the file. If the EGID and real GID of a process are the same, the process has the owner's group privileges.
The caller's EUID must match the owner's UID of the file, or the owner must be superuser.
9.When a file descriptor is assigned to something other than a terminal, it is calledI/O redirection
10.
Arithmetic:The Bourne shell does not support arithmetic. UNIX/Linux commands must be used to perform calculations.
n=`expr 5 + 5`echo $n
11.Regular expression metacharacters are evaluated by the programs that perform pattern matching, such as vi, grep, sed, and awk
12.Do not confuse this metacharacter with the shell wildcard (*). They are totally different. The shell asterisk matches for zero or more of any character, whereas the regular expression asterisk matches for zero or more of the preceding character.
13.the meaning of grep and the origin of its name. It means "globally search for the regular expression (RE) and print out the line."
- shell学习笔记(原书摘录)
- 原书摘录:第四章~第九章
- 原书摘录:第一章:新情况,新做法
- 原书摘录::第2章 横向管理工作进程的5个阶段
- 原书摘录:第3章纵向管理:巧妙制定工作计划
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第六天(留坑)
- 书摘笔记
- CSS学习笔记录(1)
- 集合类的学习笔记(原)
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第一天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第二天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第三天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第四天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第四天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第五天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第五天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第五天
- 笨方法学python(本文为阅读时从此书摘录的笔记) 第五天
- 另一篇:C# 连接SAP,并调用RFC函数 (基于Com组件)
- mysql 锁相关
- 消息弹出框在限定时间内消失
- vs2008 fatal error C1083: 无法打开预编译头文件
- 匿名内部类引用其创建类的实例
- shell学习笔记(原书摘录)
- memcached
- 在cpp文件中批量增加预编译头
- PhotoShake
- 关于WPF Dispatcher
- 感悟生命
- 使用Java SE 6 创建独立 Web Services - 客户端
- Android之Xml解析
- AS3 Flex基础知识100条