Skip to content

Commit 7b2a89a

Browse files
committed
Site updated: 2020-06-09 11:12:36
1 parent bb2af15 commit 7b2a89a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+16
-1
lines changed

2020/06/08/pagefuyunv/index.html

249 Bytes
Binary file not shown.
137 KB
Binary file not shown.

archives/2020/06/index.html

6 Bytes
Binary file not shown.

archives/2020/06/page/2/index.html

1007 Bytes
Binary file not shown.

archives/2020/index.html

6 Bytes
Binary file not shown.

archives/2020/page/10/index.html

-12 Bytes
Binary file not shown.

archives/2020/page/11/index.html

12 Bytes
Binary file not shown.

archives/2020/page/12/index.html

4 Bytes
Binary file not shown.

archives/2020/page/13/index.html

-7 Bytes
Binary file not shown.

archives/2020/page/14/index.html

1 Byte
Binary file not shown.

archives/2020/page/15/index.html

29 Bytes
Binary file not shown.

archives/2020/page/16/index.html

-7 Bytes
Binary file not shown.

archives/2020/page/17/index.html

3 Bytes
Binary file not shown.

archives/2020/page/18/index.html

-21 Bytes
Binary file not shown.

archives/2020/page/19/index.html

22 Bytes
Binary file not shown.

archives/2020/page/2/index.html

-21 Bytes
Binary file not shown.

archives/2020/page/20/index.html

987 Bytes
Binary file not shown.

archives/2020/page/3/index.html

23 Bytes
Binary file not shown.

archives/2020/page/4/index.html

-18 Bytes
Binary file not shown.

archives/2020/page/5/index.html

27 Bytes
Binary file not shown.

archives/2020/page/6/index.html

-20 Bytes
Binary file not shown.

archives/2020/page/7/index.html

6 Bytes
Binary file not shown.

archives/2020/page/8/index.html

5 Bytes
Binary file not shown.

archives/2020/page/9/index.html

-6 Bytes
Binary file not shown.

archives/index.html

6 Bytes
Binary file not shown.

archives/page/10/index.html

-12 Bytes
Binary file not shown.

archives/page/11/index.html

12 Bytes
Binary file not shown.

archives/page/12/index.html

4 Bytes
Binary file not shown.

archives/page/13/index.html

-7 Bytes
Binary file not shown.

archives/page/14/index.html

1 Byte
Binary file not shown.

archives/page/15/index.html

29 Bytes
Binary file not shown.

archives/page/16/index.html

-7 Bytes
Binary file not shown.

archives/page/17/index.html

3 Bytes
Binary file not shown.

archives/page/18/index.html

-21 Bytes
Binary file not shown.

archives/page/19/index.html

22 Bytes
Binary file not shown.

archives/page/2/index.html

-21 Bytes
Binary file not shown.

archives/page/20/index.html

987 Bytes
Binary file not shown.

archives/page/3/index.html

23 Bytes
Binary file not shown.

archives/page/4/index.html

-18 Bytes
Binary file not shown.

archives/page/5/index.html

27 Bytes
Binary file not shown.

archives/page/6/index.html

-20 Bytes
Binary file not shown.

archives/page/7/index.html

6 Bytes
Binary file not shown.

archives/page/8/index.html

5 Bytes
Binary file not shown.

archives/page/9/index.html

-6 Bytes
Binary file not shown.

content.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

index.html

8.67 KB
Binary file not shown.

page/10/index.html

624 Bytes
Binary file not shown.

page/11/index.html

2.96 KB
Binary file not shown.

page/12/index.html

601 Bytes
Binary file not shown.

page/13/index.html

-2.72 KB
Binary file not shown.

page/14/index.html

870 Bytes
Binary file not shown.

page/15/index.html

-439 Bytes
Binary file not shown.

page/16/index.html

2.37 KB
Binary file not shown.

page/17/index.html

-7.17 KB
Binary file not shown.

page/18/index.html

3.23 KB
Binary file not shown.

page/19/index.html

-10.9 KB
Binary file not shown.

page/2/index.html

-12.2 KB
Binary file not shown.

page/20/index.html

-548 Bytes
Binary file not shown.

page/21/index.html

12.5 KB
Binary file not shown.

page/22/index.html

2.12 KB
Binary file not shown.

page/23/index.html

969 Bytes
Binary file not shown.

page/24/index.html

-2.98 KB
Binary file not shown.

page/25/index.html

1.3 KB
Binary file not shown.

page/26/index.html

1.07 KB
Binary file not shown.

page/27/index.html

-989 Bytes
Binary file not shown.

page/28/index.html

-2.18 KB
Binary file not shown.

page/29/index.html

-1.06 KB
Binary file not shown.

page/3/index.html

14.7 KB
Binary file not shown.

page/30/index.html

4.85 KB
Binary file not shown.

page/31/index.html

-2.27 KB
Binary file not shown.

page/32/index.html

2.26 KB
Binary file not shown.

page/33/index.html

-8 Bytes
Binary file not shown.

page/34/index.html

-104 Bytes
Binary file not shown.

page/35/index.html

-26 Bytes
Binary file not shown.

page/36/index.html

118 Bytes
Binary file not shown.

page/37/index.html

-837 Bytes
Binary file not shown.

page/38/index.html

-149 Bytes
Binary file not shown.

page/39/index.html

2.75 KB
Binary file not shown.

page/4/index.html

-3.47 KB
Binary file not shown.

page/5/index.html

-5.75 KB
Binary file not shown.

page/6/index.html

-2.38 KB
Binary file not shown.

page/7/index.html

10.9 KB
Binary file not shown.

page/8/index.html

-3.87 KB
Binary file not shown.

page/9/index.html

779 Bytes
Binary file not shown.

search.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5628,4 +5628,19 @@
56285628
<tag>感悟</tag>
56295629
</tags>
56305630
</entry>
5631+
<entry>
5632+
<title>如何学习linux</title>
5633+
<url>/2020/06/09/pagehowTolearnLinux/</url>
5634+
<content><![CDATA[<p>转自极客时间《趣谈Linux操作系统》,专栏作者刘超,建议有兴趣的同学去极客时间订阅专栏。</p>
5635+
<h4 id="第一个坡:抛弃旧的思维习惯,熟练使用-Linux-命令行上手"><a href="#第一个坡:抛弃旧的思维习惯,熟练使用-Linux-命令行上手" class="headerlink" title="第一个坡:抛弃旧的思维习惯,熟练使用 Linux 命令行上手"></a>第一个坡:抛弃旧的思维习惯,熟练使用 Linux 命令行上手</h4><p>Linux 的第一步,要先从 Windows 的思维习惯,切换成 Linux 的“命令行 + 文件”使用模式。在 Linux 中,无论我们做什么事情,都会有相应的命令工具。虽然这些命令一般会在 bin 或者 sbin 目录下面,但是这些命令的数量太多了。如果你事先不知道该用哪个命令,很难通过枚举的方式找到。因此,在这样没有统一入口的情况下,就需要你对最基本的命令有所掌握。一旦找到某个命令行工具,替代输入框的是各种各样的启动参数。这些参数怎么填,一般可以通过 -h 查看 help,挨个儿看过去,就能找到相应的配置项;还可以通过 man 命令,查看文档。无论是什么命令行工具,最终的配置一般会落到一个文件上,只要找到了那个文件,文件中会有注释,也可以挨个儿看下去,基本就知道如何配置了。这个过程可能非常痛苦,在没有足够熟练地掌握命令行之前,你会发现干个非常小的事情都需要搜索半天,读很多文档,即便如此还不一定能得到期望的结果。这个时候你一定不要气馁,坚持下去,继续看文档、查资料,慢慢你就会发现,大部分命令的行为模式都很像,你几乎不需要搜索就能完成大部分操作了。恭喜你,这个时候你已经爬上第一个坡了。这个时候,你能看到一些很美丽的风景,例如一些很有技巧的命令 sed 和 awk、很神奇的正则表达式、灵活的管道和 grep、强大的 bash。你可以自动化地做一些事情了,例如处理一些数据,会比你使用 Excel 要又快又准,关键是不用框框点点,在后台就能完成一系列操作。在处理数据的同时,你还可以干别的事情,半夜处理数据,第二天早上发个邮件报告,这都是 Excel 很难做到的事情。不过,在这个专栏里,命令行并不是我们的重点,但是考虑到一些刚起步的同学,在第一部分我会简单介绍一些能够让你快速上手 Linux 的命令行。专栏每一模块的第一节,我都会有针对性地讲解这一模块的常用命令,足够你把 Linux 用起来。如果你想全面学习 Linux 命令,推荐你阅读 <strong>《鸟哥的 Linux 私房菜》</strong>。如果想再深入一点,推荐你阅读 <strong>《Linux 系统管理技术手册》</strong>。这本砖头厚的书,可以说是 Linux 运维手边必备书籍。</p>
5636+
<h4 id="第二个坡:通过系统调用或者-glibc,学会自己进行程序设计。"><a href="#第二个坡:通过系统调用或者-glibc,学会自己进行程序设计。" class="headerlink" title="第二个坡:通过系统调用或者 glibc,学会自己进行程序设计。"></a>第二个坡:通过系统调用或者 glibc,学会自己进行程序设计。</h4><p>命令行工具也是程序,只不过是别人写的程序。从用别人写的程序,到自己能够写程序,通过程序来操作 Linux,这是第二个要爬的坡。用代码操作Linux,可以直接使用 Linux 系统调用,也可以使用 glibc 的库。Linux 的系统调用非常多,而且每个函数都非常复杂,传入的参数、返回值、调用的方式等等都有很多讲究。这里面需要掌握很多 Linux 操作系统的原理,否则你会无法理解为什么应该这样调用。刚开始学 Linux 程序设计的时候,你会发现它比命令行复杂得多。因为你的角色再次变化,这是为啥呢?我这么说,估计你就能理解了。如果说使用命令行的人是吃馒头的,那写代码操作命令行的人就是做馒头的。看着简简单单的一个馒头,可能要经过 N 个工序才能蒸出来。同样,你会发现,你平时用的一个简单的命令行,却需要 N 个系统调用组合才能完成。其中每个系统调用都要进行深入地学习、读文档、做实验。经过一段时间的学习,你啃下了这些东西,恭喜你,又爬上了一个坡。这时候,你已经很接近操作系统的原理了,你能看到另一番风景了。大学里学的那些理论,你再回去看,现在就会开始有感觉了。你本来不理解进程树,调用了 fork,就明白了;你本来不理解进程同步机制,调用了信号量,也明白了;你本来分不清楚网络应用层和传输层的分界线,调用了 socket,都明白了。同样,专栏的第一模块,我会简单介绍一下 Linux 有哪些系统调用,每一模块的第一节,我还会讲解这一模块的常用系统调用,以及如何编程调用这些系统调用。这样可以使你对 Linux 程序设计入个门,但是这对于实战肯定是远远不够的。如果要进一步学习 Linux 程序设计,推荐你阅读 <strong>《UNIX 环境高级编程》</strong>,这本书有代码,有介绍,有原理,非常实用。</p>
5637+
<h4 id="第三个坡:了解-Linux-内核机制,反复研习重点突破"><a href="#第三个坡:了解-Linux-内核机制,反复研习重点突破" class="headerlink" title="第三个坡:了解 Linux 内核机制,反复研习重点突破"></a>第三个坡:了解 Linux 内核机制,反复研习重点突破</h4><p>当你已经会使用代码操作 Linux 的时候,你已经很希望揭开这层面纱,看看系统调用背后到底做了什么。这个时候,你的角色要再次面临变化,就像你蒸馒头时间长了,发现要蒸出更好吃的馒头,就必须要对面粉有所研究。怎么研究呢?当然你可以去面粉厂看人家的加工过程,但是面粉厂的流水线也很复杂,很多和你蒸馒头没有直接关系,直接去看容易蒙圈,所以这时候你最好先研究一下,面粉制造工艺与馒头口味的关系。对于 Linux 也是一样的,进一步了解内核的原理,有助于你更好地使用命令行和进行程序设计,能让你的运维和开发水平上升一个层次,但是我不建议你直接看代码,因为 Linux 代码量太大,很容易迷失,找不到头绪。最好的办法是,先了解一下 Linux 内核机制,知道基本的原理和流程就可以了。一旦学起来的时候,你会发现,Linux 内核机制也非常复杂,而且其中相互关联。比如说,进程运行要分配内存,内存映射涉及文件的关联,文件的读写需要经过块设备,从文件中加载代码才能运行起来进程。这些知识点要反复对照,才能理清。但是一旦爬上这个坡,你会发现 Linux 这个复杂的系统开始透明起来。无论你是运维,还是开发,你都能大概知道背后发生的事情,并在出现异常的情况时,比较准确地定位到问题所在。Linux 内核机制是我们这个专栏重点要讲述的部分,我会基于最新 4.x 的内核进行讲解,当然我也意识到了内核机制的复杂性,所以我选择通过故事性和图形化的方式,帮助你了解并记住这些机制。这块内容的辅助学习,我推荐一本 <strong>《深入理解 LINUX 内核》</strong>。这本书言简意赅地讲述了主要的内核机制。看完这本书,你会对 Linux 内核有总体的了解。不过这本书的内核版本有点老,不过对于了解原理来讲,没有任何问题。</p>
5638+
<h4 id="第四个坡:阅读-Linux-内核代码,聚焦核心逻辑和场景"><a href="#第四个坡:阅读-Linux-内核代码,聚焦核心逻辑和场景" class="headerlink" title="第四个坡:阅读 Linux 内核代码,聚焦核心逻辑和场景"></a>第四个坡:阅读 Linux 内核代码,聚焦核心逻辑和场景</h4><p>在了解内核机制的时候,你肯定会遇到困惑的地方,因为理论的描述和提炼虽然能够让你更容易看清全貌,但是容易让你忽略细节。我在看内核原理的书的时候也遇到过这种问题,有的地方实在是难以理解,或者不同的书说的不一样,这时候该怎么办呢?其实很好办,Linux 是开源的呀,我们可以看代码呀,代码是精准的。哪里有问题,找到那段代码看一看,很多问题就有方法了。另外,当你在工作中需要重点研究某方面技术的时候,如果涉及内核,这个时候仅仅了解原理已经不够了,你需要看这部分的代码。但是开源软件代码纷繁复杂,一开始看肯定晕,找不着北。这里有一个诀窍,就是一开始阅读代码不要纠结一城一池的得失,不要每一行都一定要搞清楚它是干嘛的,而要聚焦于核心逻辑和使用场景。一旦爬上这个坡,对于操作系统的原理,你应该就掌握得比较清楚了。就像蒸馒头的人已经将面粉加工流程烂熟于心。这个时候,你就可以有针对性地去做课题,把所学和你现在做的东西结合起来重点突破。例如你是研究虚拟化的,就重点看 KVM 的部分;如果你是研究网络的,就重点看内核协议栈的部分。在专栏里,我在讲述 Linux 原理的同时,也会根据场景和主要流程来分析部分代码,例如创建进程、分配内存、打开文件、读写文件、收发网络包等等。考虑到大量代码粘贴会让你看起来比较费劲,也会占用大量篇幅,所以我采取只叙述主要流程,只放必要的代码,大部分的逻辑和相互关系,尽量通过图的方式展现出来,给你讲解。这里也推荐一本书, <strong>《LINUX 内核源代码情景分析》</strong>。这本书最大的优点是结合场景进行分析,看得见、摸得着,非常直观,唯一的缺点还是内核版本比较老。</p>
5639+
<h4 id="第五个坡:实验定制化-Linux-组件"><a href="#第五个坡:实验定制化-Linux-组件" class="headerlink" title="第五个坡:实验定制化 Linux 组件"></a>第五个坡:实验定制化 Linux 组件</h4><p>已经没人能阻挡你成为内核开发工程师了纸上得来终觉浅,绝知此事要躬行。从只看内核代码,到上手修改内核代码,这又是一个很大的坎。这相当于蒸馒头的人为了定制口味,要开始修改面粉生产流程了。因为 Linux 有源代码,很多地方可以参考现有的实现,定制化自己的模块。例如,你可以自己实现一个设备驱动程序,实现一个自己的系统调用,或者实现一个自己的文件系统等等。这个难度比较大,涉及的细节比较多,上一个阶段,我的建议是不计较一城一地的得失,不需要每个细节都搞清楚,这一个阶段要求就更高了。一旦代码有一个细微的 bug,都有可能导致实验失败。</p>
5640+
<h4 id="第六个坡:面向真实场景的开发"><a href="#第六个坡:面向真实场景的开发" class="headerlink" title="第六个坡:面向真实场景的开发"></a>第六个坡:面向真实场景的开发</h4><p>实践没有终点说了这么多,我们都只是走出了万里长征第一步。我始终坚信,真正的高手都是在实战中摸爬滚打练出来的。如果你是运维,仅仅熟悉上面基本的操作是不够的,生产环境会有大量的不可控因素,尤其是集群规模大的更是如此,大量的运维经验是实战来的,不能光靠读书。如果你是开发,对内核进行少量修改容易,但是一旦面临真实的场景,需要考虑各种因素,并发与并行,锁与保护,扩展性和兼容性,都需要真实项目才能练出来。</p>
5641+
]]></content>
5642+
<tags>
5643+
<tag>技术</tag>
5644+
</tags>
5645+
</entry>
56315646
</search>

tags/技术/index.html

-18 Bytes
Binary file not shown.

tags/技术/page/2/index.html

-18 Bytes
Binary file not shown.

tags/技术/page/3/index.html

60 Bytes
Binary file not shown.

tags/技术/page/4/index.html

989 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)