Current location - Recipe Complete Network - Dietary recipes - How can I learn linux well?
How can I learn linux well?
The experience from Baidu aims at how to learn the network materials of linux well.

At present, it is a hot forum for learning Linux system.

Talking about how to learn Linux operating system, from the network information of 5 1cto, reference /289555 1/569329.

If you really want to learn the linux system well, you still need to study the linux kernel source code.

Why do you say that?

Whether you use some commands in linux or do the development of linux application layer, you are actually using the functions of linux kernel, but in fact you don't know the underlying mechanism of linux. In the long run, it won't improve your skills much.

For example:

1. You use the docker command in linux every day. Do you know how docker achieves this isolation?

2. When you write a linux application, you will see that the entry is the main () function. So, the question is, why is main ()? Why not hello (), fuck () and love ()?

3. When you write a linux application, you can also use the write () function. This write function is not implemented in our code, so who implemented it? Is it library C? It's possible. But what if I write to a disk? Can c library do it?

Obviously not! Still need the function of linux kernel.

4. We know that in linux, different applications can share a dynamic link library. How is this done? Didn't you say that the process was isolated? Why not isolate the dynamic link library?

5. Does the Linux application layer call malloc directly to the kernel?

Obviously not! There is also memory management in the C library. The memory management unit in the C library will wholesale the memory to the kernel (in page), and then retail the memory to the application (with smaller granularity, such as the size of int and char).

6. What are the similarities and differences between processes and threads in Linux? Don't lecture with the textbook, what you get from the code is the true knowledge.

....

There are too many questions, aren't you curious?

If you are not curious, it is obvious that you are not suitable for technology, and you may not go far on the road of technology, so you should change careers as soon as possible; If you are curious, study the linux kernel from now on.

As a person who has been developing code under linux for more than ten years, I can't help but say a few words about this problem.

If you want to learn any skill thoroughly, you have to make great efforts, especially some professional skills, and you need to devote a lot of energy to study and practice for a long time. For example, learning linux is a very professional skill. How can you learn this skill well?

How can I learn that well?

Ideological attention should first understand why you want to learn linux and what learning linux can bring to you, that is to say, you should know the importance of learning linux well. When you realize how important a thing is to yourself, how much energy you will put into it.

With the ideological emphasis on the concreteness of action, concrete actions are needed below.

(1) Learn from the basic knowledge and lay a good foundation; To learn any new knowledge, we should know some basic contents, basic concepts, etc., so we need to find a professional book to introduce linux, and get a general understanding of the relevant contents of linux first, so as not to understand some of the most basic professional names when learning linux later.

(2) study hard and practice more, and think more; Linux is a very practical technology, and the study of basic theory is to better realize the application, which in turn will consolidate the theoretical knowledge; Find a set of development board with relatively complete functions, realize various functions on the development board, practice constantly, and find answers with questions. When watching the functions designed by yourself realized on the development board, you will be happy.

In short, learning Linux well is by no means a one-off event, and the accumulation of time and knowledge is essential.

Linux is a big concept. It is suggested to start with something simple, combine your interests and work content, and dig deep in a certain aspect to introduce the learning and upgrading of Linux.

Beginners can install a desktop version of Linux virtual machine (Ubuntu, CentOS7, etc.) to familiarize themselves with common commands. After mastering the environment basically, you can study the construction of kernel source code and common servers to deepen your understanding and application. Let me briefly introduce the learning process of Linux, and interested friends can try it:

0 1 Install Linux It is recommended to install a desktop version of the Linux virtual machine (Ubuntu, CentOS7 and other distribution versions will do). If you are a beginner, if you are completely unfamiliar with Linux, it will be very uncomfortable to install the mini version. Many functions and packages need to be downloaded by yourself. You can use the desktop version first, so as not to be completely at a loss. When you are familiar with the environment later, you can use the unbounded version, which will be very easy to operate.

After installing the Linux virtual machine, it is the basic introduction of Linux. There are a lot of online tutorials and materials here, such as massive open online course, Rookie Tutorial and bilibili. Of course, you can also find a professional Linux book and practice while learning. Brother Bird's Private Kitchen is very good, with a wide coverage and detailed explanations. You should be familiar with the common basic commands and configurations, which are the basis of using Linux.

After getting familiar with the basics of Linux, it is the process of going deep into Linux. There are many things to learn and study here. Basic Linux applications, including server construction and embedded development, have very bright prospects. Of course, you can also study the Linux kernel, including memory management, process management, file system, drivers, etc., which can be said to be of great benefit for a deep understanding of the operating system:

After all, Linux is just an operating system. As long as you master the correct learning method, it won't be too difficult. Today, let's take a good look at how to learn Linux is the correct learning method. Transfer from-Marco linux operation and maintenance

First, start from the command and start from the foundation

Often, some friends want to build a website as soon as they come into contact with Linux, and they never think of knowing the basics of Linux first. This is quite difficult. Although Linux desktop applications have developed rapidly, commands still have strong vitality in Linux. Linux is an operating system consisting of a command line, the essence of which lies in the command line. No matter what level the graphical interface develops, this principle will not change. Linux commands have many powerful functions: from simple disk operation and file access to making complex multimedia images and streaming media files. Here, the author introduces the most important and frequently used commands in the system into several parts according to their functions in the system. We can further understand the Linux system through the study of these basic commands:

Installation and login commands: login, shutdown, halt, reboot, mount, umount, chsh.

File processing commands: file, mkdir, grep, dd, find, mv, ls, diff, cat, ln.

Commands related to system management: df, top, free, quota, at, lp, adduser, groupadd kill, crontab, tar, unzip, gunzip, last.

Network operation commands: ifconfig, ip, ping, netstat, telnet, ftp, route, rlogin rcp, finger, mail, nslookup.

System security related commands: passwd, su, umask, chgrp, chmod, chown, chattr, sudo, pswho.

Second, choose a good Linux book

In various linux forums, the most common problem we see is often a novice. When encountering a specific problem in the process of installing or using Linux, we begin to ask questions, many of which are repetitive, and even many people are not very clear about the basic problem description. This shows that many beginners of linux have not mastered the basic skills. How can we quickly improve the basic skills of mastering linux? The most effective way is to learn authoritative linux reference books, which are very important for learners. A reference book with a wrong idea will lead the novice astray. At present, there are many books about linux in China, but there are not many excellent ones. I strongly recommend reading "Brother Bird's Basic Linux Private Kitchen", which is now in the third edition. It is best for beginners to buy a paper book to study it carefully and take study notes carefully. Of course, if you are used to reading e-books, you can also download PDF e-books from here.

Third, get into the habit of working under the command line

Be sure to get into the habit of working under the command line, knowing that X-window is just an application running in the command line mode. Although learning under the command line is slow at first, your future learning path will increase exponentially after you get familiar with it. From the perspective of network administrators, the command line is actually a rule, which is always effective and flexible. Even through a slow modem line, it can operate remote systems thousands of kilometers away.

Fourth, think about Linux with Unix thinking

Because Linux is designed with reference to the thought of Unix, understanding and mastering it must be carried out with the thinking of Unix, not with the thinking of Windows. Undeniably, a large part of the success of windows in the market lies in the uniqueness of technical ideas. However, this innovation is carried out under the premise of facing individual users, and facing enterprise-level service applications, it is still somewhat inadequate. For many years, it has been the only one in the field of computer operating system: unix in the field of servers and Windows in the field of individual users. It can be seen that the user needs determine the operating system adopted. For whatever reason, if you want to learn Linux, you should first drag your thinking out of the "river" of Windows and put it into the sea of Unix.

Five, learning shell

For Shell (Chinese name Shell), readers who are used to Windows must be very strange, because Windows has only one "Shell" (if it can be said to be a shell), and that is Windows itself. The easy-to-understand explanation in one sentence is that the shell is the intermediary between the user input command and the system interpretation command. Most intuitively, a Shell has its own set of commands. To give an easy-to-understand example, the standard Shel of Linux is Bash Shel; The shell of Solaris is B shell; The Shell of Linux is represented by the command line. Readers may not understand that Windows has "evolved" from the command line to the graphical interface, so isn't it a retrogression that Linux still uses the command line?

I had this idea when I first came into contact with Linux. However, it was later found that if the graphical interface was used, the resources allocated to the application software would be less, and it was very important to realize the same function with lower hardware configuration on the expensive server.

For example, a server has 1GB memory, assuming that 5 12MB of it is used to process graphical interfaces, the only way to install a database software that needs 784MB of memory is to expand the memory. But if you use the command line, the system may only need 64MB of memory, and other memory can be used by database software. Using the command line, not only the memory, but also the CPU and hard disk will save a lot of resources. Therefore, using the command line as a server is an advantage rather than a disadvantage. Since Shell has so many advantages, we must learn it.

Simply put: interest, persistence, and methods.

Interest first For anything, interest will greatly affect the result of what you do. To do something you are very interested in, and to do something you have no interest in but have to do for some reason, the result is often the difference between heaven and earth. The reason is nothing more than doing something that interests you, and doing it with a mentality of enjoying it. Unconsciously, you will put more thoughts into it, and you will be more focused and easier to stick to it. For things that have no interest, they are often forced to do it under some pressure, and there will be some rejection and even a feeling of suffering in their hearts, and the result can be imagined.

The same is true for program development. At work, programmers are the same, but there are often two different people. One is really interested in program development. A day without writing or reading code is like sitting on pins and needles, feeling that something is always missing this day, and often this kind of person can become a great god among the technical population. The other kind of people, on the other hand, read and write code because they have to do it completely because they have completed the task. When dealing with problems, they can fool around and never look at the code, so such people are often mediocre in technology. Of course, this is only from a technical point of view. If we simply look at income, the first type of people may not have higher income than the second type.

Therefore, first of all, we must determine whether we are interested in program development. If we are not interested, we naturally don't have to continue, and we can completely change our career choices. Then choose a direction that you are most interested in, such as kernel development, driver development, application development, etc. After selecting the direction, proceed from shallow to deep, step by step.

Perseverance Today, with the rapid development of the Internet, we are in an era of rapid knowledge explosion and renewal. Every day, all kinds of new things emerge one after another, and of course, all kinds of old things will disappear. This is especially true for computer technology, from programming languages to development tools, from design patterns to system frameworks, new technologies will appear in every field every day, and old technologies will never be eliminated, discarded and forgotten.

This means that from the day you become a programmer, you can't stop learning and have to face the upgrading of various technologies. Therefore, you must continue to learn and update your knowledge structure in time to adapt to the changes in various business needs, otherwise you may have to face the result of being eliminated.

Finding a suitable learning method is just like watching a movie. Some people find the same movie wonderful, while others find it boring. Everyone's habits, personality, thinking, background and foundation are different, and their learning methods are different. There is no one-size-fits-all method, but the one that suits them is the best.

For getting started, find a book that you can understand and suit yourself. Many classic books recommended by others can be called the Bible. Try it and see if you can understand and digest it easily. If you really don't understand it, change it decisively, and don't be too reluctant. When you first get started, if you stay in a fog for a long time, it will often hit your confidence and then consume your interest in continuing to learn. Many biblical books are often suitable for careful reading after a certain foundation, but they are not the first choice for getting started.

After getting started, it gradually deepened. Generally speaking, learning in practical projects is the best. In the process of doing a project, you can often consolidate the skills you have learned, and at the same time find your own knowledge blind spots, and then eliminate them.

In addition, read more codes and write more codes.

Finally, cherish every hair you have now. There are two distributions of linux series.

1).Red

Hat system, including RHEL, fedora, centos, etc.

2).Debian system, including Debian, Ubuntu, Mint, etc.

If you want to study, if you study personally, Ubuntu is recommended. If it's work, use centos to study.

1. To learn linux, the first thing is to install the Linux system. Through image installation, this process can first get a general understanding of the startup process of Linux and have a general impression of some concepts.

2. On the installed system, learn the operation of some basic commands, such as ls. List subfiles and subdirectories in the current folder, switch cd /root to the directory of root, top command to check the usage of cpu, memory and other resources of some processes, ps command to also check the usage of memory and other resources of processes, pwd to check the current path, etc., and master these commands skillfully.

3. After mastering some basic commands of linux, you can do some service installation exercises, such as installing and building DNS servers under Linux, building nginx servers and so on.

4. In the advanced stage, you can try to optimize the kernel parameters, such as maintaining the high-speed channel after tcp closes the connection and expanding the maximum number of handles opened in linux system. sysctl -a can check the kernel parameters that have been loaded at present.

Learn to make sentences, then you can write a composition later. By the same token, after learning the commands of linux, you can learn the basic statements of shell, learn awk sed, and use shell to realize some scripts with specific functions, for example, you can realize the statistics of cpu-related information through cat /proc/cpuinfo and awk command.

If you are a little white on Linux, please see the following answer ~

If you want to learn Linux well, ask yourself a few questions first.

1. Are you interested in computers?

2. Why learn Linux (what value can it bring to you, and whether this value point can support you to stick to it all the time)

3. How much time can you spare to study after work and life or after college every day (any skill needs time to practice+time to master)

If the answers to these three questions are yes, please see the following:

I am also a small white who started to learn from the technical foundation of 0.

I recommend a tutorial: rookie tutorial.

/linux/linux-tutorial.html

You must have patience and perseverance to finish the study, so that you can have a certain understanding of Linux.

In the middle of learning, you need to practice constantly, knock the command, install and verify yourself.