Learn Linux in the simplest way

Source: Internet
Author: User

There are lots of books about Linux, blogs. Most of them will be "rude" to plug a lot of commands to the reader, so much more. NET programmer to be deterred. They passed by without entering the door.

So I envision a smoother way of learning, which is to introduce Linux backgrounds and motivations in plain language first when learning commands. Just as all the online games have to introduce the history of the game, and then introduce the game operation.

Most beginners will have a very strange feeling when they just touch Linux. There are often doubts and problems. And we follow these questions, from far and near, from macro to micro to understand the simplicity and beauty of Linux.

Issue 1:winows There is a registry, why Linux does not have a registry

The registry is a Windows core component that configures the entire system. Linux is the entire file system as the "registry", the Windows registry tree structure, can roughly correspond to the Linux file system tree structure.

The Linux configuration file is equivalent to the registry key, or Linux uses a distributed registry.

So why is Linux so designed? Because Linux is the so-called network operating system, so a single computer is not the boundaries of Linux, if it is a system composed of multiple computers, then distributed management has a huge advantage.

For example, the damage to a disk that contains a configuration file does not paralyze the entire system, but may simply invalidate some of the functionality.

The problem 2:windows has a perfect graphical interface, and why Linux should learn the command line.

First, the command line is definitely more advanced than the graphical interface. The command line is the programmer's first interface, and the graphical interface is the first interface of the ordinary user.

Perhaps a lot of people will have different views, in fact, we think about a step forward, it is very clear.

What is the next step in the command line evolution? The simple thing is voice control, which translates human natural language into commands.

What is the next evolution of the graphical interface? is posture control. There are only 3 poses for the current Windows system, click, double Tap, drag and drop. The more advanced ipad has a toggle, circle and so on.

Posture control is simple, user-friendly, voice control is very complex, but the control accuracy is very high.

As programmers we require computers to do more than ordinary users, so it is very efficient to use the Command Guild.

To step back, the graphical interface is also the command line, but the gesture is translated into command execution.

Programmer programming Code is also "command line", a one-piece instruction.

All in all, as long as you can break the fear of the Linux command line, the next thing will be very easy. This command line is definitely not the command line you can imagine, it is very intelligent.

Problem 3:linux There are so many directories, so many orders, how to remember to live?

First, the Linux directory is the most soul of the Linux system, all the hardware can be abstracted as a file, so as to achieve networking. (The internet is just a further evolution of unix/linux)

So as long as you master the rules of the Linux directory, on the basis of understanding the memory can be much easier. In addition, the Linux command line has the intelligent function, can let you to play less than 95% characters to complete the command.

It's not as if you're imagining a bunch of stupid orders, and those who use Linux Daniel are very smart, how can they make themselves hard?

Problem 4:linux The folder structure looks very complex, how to understand it?

We assume here that we are the designers, and if we design a filesystem, how do we do it?

We need a starting point, which is called the root directory, denoted by "/", then we need to start Linux, then we will put all the core boot files (including the Linux kernel itself) into a "/boot" directory.

When the system starts, we need to execute some basic commands in the operating system, these commands will be placed in the "/bin" directory. These commands may then use some libraries, which are placed under "/lib", and these libraries may use some device driver files.

The driver files are then placed in the "/dev" directory.

/: Root directory

/boot: System boot and kernel

/bin: System basic Command (bin is the abbreviation of binary)

/lib: System library (code that cannot be run directly) (Lib is an abbreviation for libary)

/dev: Device driver (Dev is the abbreviation for device)

So far, only 5 directories, very simple.


Question 5: What is "/usr", "/etc" and "/var"

When the user starts the system, to do some more complex work, this time will involve a call "/usr", the situation is slightly complicated, is a difficult point. But it's easy to explain.

Early UNIX systems have a lot of hard disk, when the capacity of the hard disk is very small, so often a hard disk only put a directory, such as "/boot" can be placed on a separate "boot" disk, the above mentioned 5 directory, is necessary for system operation.

And when the system is started, we need some other program for the specific work, we will load a "/usr" directory, which puts the important running program.

It is easy to doubt that the name "USR", historically, this is actually the user's abbreviation, but now and the user does not have any relationship, you can think of it as "universal software resource" abbreviation.

This "HTTP://WWW.51969.COM/USR" is a bit like the program Files in Windows.

So the difference between/bin and/usr/bin is that the procedure inside the/bin is more central.

At this time, many people will have doubts, we remember which commands in the/bin or in the/usr/bin?

Rest assured, because all bin directories are registered to the system variable path, so no matter what you are in any current directory, just enter the name of the command file, the system will help you find this command and run.

Points:

1,/usr above are generally read-only files, data files and configuration files are not placed on the above (where to go, later will speak)

2, no "/usr", Linux system can also run normally

2./usr can be shared by multiple computers (this shows the network of Linux systems)

Since/USR only places read-only files, where do the configuration files and data files go? 2 new Directories "/etc" and "/var" appear here

It is easy for beginners to confuse the name of this 2 directory.

In the history of "etc" is "etcetera", Chinese meaning "other", now this and "other" does not have any relationship, is specifically to store the configuration file place, can be understood as "editable text configuration" abbreviation

For example,/etc/mysql is the configuration file for MySQL/ect/apache2/is apache2 configuration file

In the history of "var" is "variable", Chinese meaning "change", is now mainly used to store log,lock and other documents.

For example,/var/mysql is the log used to store MySQL.

Question 6: Where do users put their own data?

When we run the program, it produces a lot of our own results, where do we put them? There is a "/home" directory, but you cannot put it directly into the "/home" directory, because Linux is a multi-user operating system, so the system will have a directory named after the user.

For example: The user is Jack, then the directory is/home/jack, this directory can also use "~" to express.

So far, we. NET programmers also have a basic understanding of the composition of Linux.

Learn Linux in the simplest way

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.