Linux relearning (a) - Learning Route Planning

1 abandon the old culture, meet new culture Linux commands

Linux first step, thinking from Windows to switch to Linux "file command line +" mode

In Linux, what are the appropriate command. Usually in the bin or sbin directory, the vast amount. If you do not know in advance which command is difficult to find by enumerating ways. Therefore, in this case there is no unified entrance, you will need to master some basic commands.

Once you've found a command line, replace the input box are various startup parameters.

How to fill these parameters,

  • General help can be viewed by -h, you will be able to find the appropriate configuration items
  • You can also order by man, view documents

Whatever the command-line tool, the final configuration will generally fall on a file, as long as the file is found, the file will have a comment, you can also read on one by one child, you know how to configure the basic.

Overcome the first difficulty. This time, you can see some very beautiful scenery, such as some very skilled command sed and awk, regular expressions is amazing, flexible pipes and grep, a powerful bash. You can automate to do some things, such as processing some data, use Excel to quickly and accurately than you, the key is to do little box in the background to complete a series of operations. While processing the data, you can also do other things, middle of the night to process data, send e-mail to report the next morning, this is a very difficult thing to do Excel.

2 or glibc calls through the system, to master programming

Command-line tool is a program, just a program written by someone else. From a program written by someone else, to be able to write their own programs, through the program to operate Linux, this is the second to overcome difficulties.

Linux operation in code, can be directly used Linux system calls can also be used glibc libraries.

Linux system calls is very large, and each function is very complex, the incoming parameters, return values, calling the way, and so have a lot of stress.

There is need to have a lot of Linux operating system principles, or can not understand why this should be called.

When just beginning to learn Linux programming, you will find it is much more complex than the command line.

Because your character changes again.

If people are using the command line to eat bread, that writing code operation command who is doing bread. Looking at a simple bread, it may take the N processes can be steamed. Also, you will find a simple command line you usually use, but it requires a combination of N system call to complete. Where each system call should be carried out in-depth study, read the document, do the experiment.

After a period of learning, you overcome these things. At this time, you've been very close to the principles of the operating system, you can see another round of scenery.

Those theories university to learn, you come back to see, and now will begin to have feelings.

  • Process tree, called fork
  • Process synchronization mechanism, calling semaphore
  • Dividing line network application layer and the transport layer, call socket

All understand!

3 again exploring the Linux kernel

When you have code that will operate using Linux, you certainly hope to uncover the veil and see behind the system call in the end what has been done .

Learn more about the core principles will help you make better use of the command line and program design, make your interview and level of development to the next level, but do not recommend direct look at the source code, because the code is too big Linux, it is easy to get lost.

The best way is to first look at the Linux kernel mechanism to know the basic principles and processes .

However, Linux kernel mechanism is very complex, and which is associated with each other.

For example, the process runs to allocate memory association, memory-mapped files involved, read and write files need to go through block devices, load the code to run up the process from a file. The knowledge to be repeated in control, to sort out.

But once overcome! You will find this complex system Linux began to clear up.

Whether you are operation and maintenance, or development, you can probably know what happened later, and in the case of abnormal, more accurately locate the problem.

Linux kernel mechanism is the focus of our study, the Core latest 4.x-based.

Assisted learning, recommended "in-depth understanding of the LINUX kernel."

This book succinctly describes the main kernel mechanism. After reading this book, you will have an overall understanding of the Linux kernel. But the book version of the kernel a bit old, but for the understanding of the principles is concerned, there is no problem.

4 Read the Linux kernel code, focus on core logic Scene

Often encountered when looking at the book's core principle of this problem, in some places it is difficult to understand, or a different book that is not the same, this time how to do it? In fact do very well, Linux is open source Yeah, Yeah, we can look at the code, the code is accurate. Where there are problems, find that code look, a lot of problems there is a way.

In addition, when you focus on certain aspects of the technology at work when required, if it involves the kernel, this time no longer enough just to understand the principles, you need to look at the code in this section.

But open-source software code complicated, certainly beginning to see faint, get lost. Here's a trick, is to start reading the code not to tangle the pros and cons of a pool in a city, not each row must be clear that it is doing, but to focus on the core logic and usage scenarios.

Once climb the slope of the principles of the operating system, then you should grasp more clearly. Like people have steamed bread flour processing procedures by heart. This time, you'll be able to do targeted topics, the things you learn and do now combine major breakthroughs.

  • Study virtualization, we look at the focus KVM
  • Research Network, focused look on the kernel stack

Recommend "LINUX kernel source code Scenario Analysis"

This book is the biggest advantage is the combination of scene analysis, visible, tangible, very intuitive, the only drawback is the older version of the kernel.

5 experiments customized Linux components

Modify the kernel code from a look at the kernel code, to get started, this is a big bucket.

Because the Linux source code, many places can refer to the existing implementation, customization own modules.

For example, you can implement yourself a device driver to achieve its own system call, or implement its own file system, and so on.

6 for combat development

If you are operation and maintenance, only familiar with the basic operation of the above is not enough, the production environment have a lot of uncontrollable factors, especially the large-scale clusters even more so, operation and maintenance of a large number of actual combat experience is to come, can not rely on reading . If you are a developer, minor modifications to the kernel is easy, but when faced with the real scene, to consider a variety of factors, concurrent and parallel, locks and protection, scalability and compatibility, you need to practice it a real project.

7 summary

reference

Linux command line

Guess you like

Origin www.cnblogs.com/JavaEdge/p/11297019.html