Linux learning road (learning Linux must see)

With the upgrading of the Internet industry, Linux has become the mainstream system of most Internet industry companies. Many students have not much contact with Linux, and they have no knowledge of Linux platform development. The current trend increasingly shows that, as an excellent software developer or computer IT industry practitioner, mastering Linux is a very important source and means of earning a living.

Next, I will combine my several years of personal development experience, Linux, UNIX-like systems, and open source software culture to talk about Linux learning methods and some things that should be paid attention to in learning.

As just said, many students may not even know what Linux is before, and they don't even know anything about UNIX. So let's start from the most basic, and we won't talk much about the history of Linux and UNIX, and we will go directly to the introduction.

Getting started with Linux is very simple. The question is whether you have the patience, whether you like to toss, and whether you do not reject overhauls such as reinstallation. It can be said that you can't learn Linux well without tossing. Brother Bird said that you must really understand the partitioning mechanism of Linux and be quite proficient in using LVM. You can't accumulate Linux installation experience without more than 20 times, so don't be afraid of tossing.

Since everyone used Windows before, I also try to take care of these "noobs". My recommendation, if you are new to Linux, then try it in a virtual machine first. I recommend Virtual Box for virtual machines. I do not advocate using VMs because VMs are closed source and charged. I don't want to promote piracy. Of course, if you have enough Money, you can try VM, but what I want to say is that even VM is not necessarily good.

Paid software is not necessarily good.

First of all, Virtual Box is very small, the installation package under the Windows platform is about 80MB, and the VM is easily 600MB. Although it is powerful, it consumes a lot of resources, not to mention that Virtual Box can fully meet your needs. So, choose it yourself.

How to use the virtual machine is your business. I won’t teach you this because it’s very simple. If you don’t know how to use it, Google or Baidu can do it. If you are good at English, you can read the official documents directly. Now introduce the knowledge of Linux distribution.

As you can see, Linux distributions are not Linux. Linux only refers to the kernel of the operating system. As a student, don’t let me explain, I don’t have time.

The distributions I recommend are as follows:

  • UBUNTU is suitable for developers who are pure novices, who pursue stable official support, have weak requirements for system stability, and like the latest applications, relatively speaking, who do not like tossing about.

  • Debian, a much more difficult release than UBUNTU, is characterized by a stable and easy-to-use package management system. The disadvantage is that it lacks enterprise support and develops drivers for the community.

  • Arch is the first choice for developers who are chasing fashion. The advantage is that package updates are quite fast, seamless upgrades, one installation can basically continue to operate, there is no version concept like UBUNTU, the professional point is called rolling upgrade, to keep your system certain Is the latest. The disadvantages are obviously easy to see and unstable. At the same time, the installation and configuration is more troublesome than Debian.

  • Gentoo, which is more difficult than Arch, tests the comprehensive level of users. From system installation to fine-tuning, kernel compilation is personally experienced. It is the first choice for masters and hackers to display their own technical means and configure systems that meet their requirements on demand.

  • Slackware is similar to Gentoo.

  • CentOS, a re-engraved version of RedHat maintained by the community, is completely recompiled and generated using RedHat's source code. The compatibility with RedHat is theoretically the best. If you focus on Linux servers, such as network management and site setup, then CentOS is your choice.

  • LFS, the ultimate hacker display tool, is completely installed from source code and compiles the system. All you get before installation is one document. All you have to do is follow the instructions in the document, step by step, order by order, and software packages to build your Linux. It is completely under your control and what you want is what you want. . If you have made LFS, it proves that your Linux skills are quite good. If you can learn and use the LFS documents, and then port Linux from the source code to the embedded system, I dare say that Chinese companies can mix very well. it is good.

For those who want to engage in C/C++Linux server development or Linux embedded development who want to switch to the Internet industry, the bottleneck of technology is a problem of cognition. Recognition is not a matter of knowing its name. It is also necessary to know the cause, and even more. Its original

Improve yourself by taking a long time, imperfect technology stack, unstructured structure, and poor self-discipline. Here is a systematic learning video for everyone, click on the link to subscribe and listen to it for free: https://ke.qq.com/course/417774?flowToken=1013189

 

1. Linux basics

You have to pick a system that suits you, install it in a virtual machine, and start using it. If you want to learn Linux quickly, one of my suggestions is to forget the graphical interface. Don't think about whether the graphical interface can provide the answer to your question. Instead, look around the world and ask how to solve your problem with the command line.

In this process, you'd better be able to master the Linux commands well, at least know the commonly used commands, and at the same time establish your own knowledge base, which contains all the knowledge you have accumulated.

2. C/C++ development on Linux platform, as well as Bash script programming [JAVA]

In the next stage, you need to learn C/C++ development on the Linux platform, as well as Bash script programming. If you are interested in Java, there is also Java. Similarly, I suggest you abandon the graphical interface IDE and start with VIM. Why is VIM instead of Emacs? I have no intention of starting an editor war, but I think VIM is suitable for beginners, suitable for developers with dumb hands and slow heads. . Emacs has too many keys and too complicated, I am afraid. Then there is GCC, Make, Eclipse (Java, C++ or).

Although C++ is listed in Eclipse, I do not recommend using IDE to develop C++, because this is not the culture of Linux, and it is easy for you to overlook some issues you should pay attention to. IDE makes you lazy, too lazy to be like a pig. If you are interested in program debugging and testing, you must learn GDB very well. If it is not GDB, it is also a required course. This is the first step of development. Note that I haven't mentioned the content of Linux system API. Don't care about this at this stage. What you have to do is to accumulate experience, development experience on the Linux platform.

The book I recommend is as follows: C language programming. C language, white paper is of course better. C++ recommends C++ Primer Plus. I don't like Java, so I don't recommend it. A list of other people's books is attached: Java introductory books. In terms of tools, I recommend the official manual of VIM, GCC Chinese document, GDB Chinese document, GNU open source software development guide (e-book), assembly language programming (allowing you to have a preliminary understanding of libraries, links, embedded assembly, and compiler optimization options. No depth required).

If you can't get past this stage, you don't have to do it, this is the bottom line, the most basic foundation, otherwise leave, don't use Linux development. The programs made by unprofessional Linux developers are contrary to the Linux culture or the UNIX culture. The programs are not far away, and they cannot be like Bash and VIM. So if you don't do it well, just leave.

3. Advanced programming in UNIX environment (the author died young, the third edition will be published soon, wait)

Advanced programming in the UNIX environment can be called a masterpiece, a classic among classics.

Next, enter the Linux system programming, the best choice, APUE, UNIX environment advanced programming, read it over and over again, reading 10 times is not too small, if you can turn this book through in university, the content inside has been practiced, yes Works, your verbal skills are strong enough, you can persuade all examiners during the interview.

(It may be a bit exaggerated, but APUE is definitely a biblical reading, even Windows programmers draw nourishment from it, the desk books of the founder of Google, and the bedside readings of Zalberk.)

After reading this book, you will have a good understanding of Linux system programming, and know what is the difference between Linux and Windows platform development? What are their advantages and disadvantages? My summary is as follows: Doing Windows platform development is very difficult. Microsoft's system API is always expanding. If you want to use the latest and most efficient functions, you must always learn the functions that are most suitable for the current popular system. Linux is not. There are only 100 core APIs of the Linux system, which can be memorized with good memory. And it will last for a long time, why not change, because it must be compatible with UNIX and comply with POSIX standards. Therefore, most of the development of the Linux platform focuses on low-level or server programming.

This is its advantage. Of course, graphics are the weakness of Linux, but from the perspective of a developer, I don't care, because I can adapt to the command line. If there is a better graphical interface, I will treat it as a gift. In addition, Windows is closed source. You don't even know what the system does. You will always be led by the nose by Microsoft. Think about it if Microsoft says Win8 does not support QQ, then Tencent must not cry to death. Linux is completely open source, you don't like it, you can change it yourself, as long as you have enough skills.

In addition, although Windows is used by many people, it is used in a single place, focusing on the desktop. And Linux has developed in all aspects, especially in cloud computing, server software, embedded fields, and enterprise-level applications. It has broad prospects and first-class compatibility. Because of the support for POSIX, it can run seamlessly on UNIX systems. Apple's Mac or IBM's AS400 series are fully supported. In addition, the Linux development environment support is absolutely first-class, whether it is C/C++, Java, Bash, Python, PHP, Javascript. . . . . . Even C# supports it. And Microsoft is not very friendly except the Visual Stdio suite, is it?

If you have a lot of feelings after reading APUE, and hope to verify some of your ideas or experience, recommend the art of UNIX programming, the world's top hackers will share his views with you.

4. Choose direction: network, graphics, embedded, device driver

Network direction: server software writing and high-performance concurrent programming

Now it's time to do the diversion. I roughly divide it into four directions: network, graphics, embedded, and device drivers.

If you choose the network and subdivide it, I am not familiar with the others. I only talk about writing server software and writing high-performance concurrent programs. Relatively speaking, this is the most technical and low-level network programming. It requires a lot of experience, reading a lot of books, and doing a lot of projects.

My view is to read the book in the following order:

  1. Further reading of APUE-especially process, thread, IPC, socket

  2. Multi-core programming-Pthread must be thoroughly understood, you are very NB

  3. UNIX Network Programming-Volume One, Volume Two

  4. TCP/IP Networking Explained-Volume should read the above two books repeatedly

  5. 5. TCP/IP network detailed explanation-Volume 2 I think it is almost the same when I see volume 2, of course, it is better to read volume 3, work hard, try to read it

  6. 6. Lighttpd source code-this server is also very famous

  7. 7. Nginx source code-Compared with Apache, Nginx has less source code. If you can look at it roughly, it is NB. Looking at the source code is mainly to learn the socket programming and concurrency control inside. I am excited to think about it. If you have these skills, you can try to submit your resume to Blizzard, write server backends for them, and think about the world of Warcraft running on your server software.

  8. Linux kernel TCP/IP protocol stack-deep understanding of the implementation of TCP/IP

If you still like driver design, you can look at the lower-level protocols, such as the link layer, what routers, network cards, network device drivers and embedded system software are written should not be a problem.

Of course, the average Internet company, even the Baidu level, should not hesitate to hire you. It just takes time and experience to read these latter books, so do it before the age of 35! Change jobs to a place for your future!

The graphics direction, I think the graphics direction is also very promising, the following aspects.

  1. The industry and game development of Opengl are relatively mature abroad.

  2. Film and television animation special effects, such as Pixar, are also relatively mature abroad.

  3. GPU computing technology can be applied to browser web page rendering and GPU computing resource utilization. Due to open source reasons, there are many document programs for reference. If you can enter Firefox development, or google do browser development, it should be very good.

Embedded direction: The embedded direction is not mentioned, Linux is very important.

To master multiple architectures, not only X86, ARM, microcontrollers, etc. must also be understood. I don’t understand the hardware. I foresee you will die on the way. I also want to go to the embedded direction, but I think that the school teaches embedded methods, and I can’t even compete with the students who study electronics. I advise everyone, you must understand the hardware before you do it. If you go to embedded application development, I can only wish you good luck. Don't run into companies like Nokia and Hp, otherwise you will be miserable.

Driver design: The software development cycle is very long, and the hardware is different and fast. With so many new hardware being born every month, how to make them work on Linux is your job. Because Linux has good compatibility, if it is not too low-level driver, the basic C language can be done, and the system architecture has little impact. Because of the system support, you may make some changes to use the PC hardware on ARM. Therefore, hardware-driven development is not like an embedded system, which requires high hardware knowledge.

Guess you like

Origin blog.csdn.net/Linuxhus/article/details/112528621