Linux Command Learning Article 0-Origin
Yesterday, when I used curl to send a simple HTTP request for testing, I found that every time I used it, I checked others' examples on the network to remember how to use it. This is too inefficient, although the network is still there, I always feel that I have not been mastered by myself, and I am not steadfast in my mind. In retrospect, I used Linux almost in year 34, from the very beginning, I started to use a basic Linux tutorial book (not the book of laruence). I started to use various linux commands and some knowledge about simple shell programming, however, at that time, I only mastered some common commands. For most of the commands, I may be afraid or bored when I try to view the documents again, in the process of viewing through the man command, you cannot grasp the use of a single command, but only a certain parameter of the command, which will be used in the future, in fact, there may be another simpler and more effective solution, which I don't know at all.
In view of the above problems, I think it is necessary to calm down and learn the linux commands that are frequently used, in this way, I will be more confident when I say "familiar with the Linux operating system" (of course, this sentence is not just a command, in addition, it also allows you to collect part time, stick to one thing, and exercise your persistence in one thing. This is what you were most lacking in the past.
There are hundreds of Linux commands, and we usually use dozens of commands. First of all, let's start with dozens of commands, mainly referring to the man command description, in this way, you can exercise the reading ability of your English documents. Each command can be used with examples to describe how to use each parameter and how to use it in combination. Of course, some commands may be very complicated, it may take a while to learn it, but now it is enough time. If you collect the fragmentation time, you will surely be able to overcome it as long as you can stick to it.
Linux commands are generally stored in/usr/local/sbin,/usr/local/bin,/usr/sbin,/usr/bin,/sbin,/bin, generally, we do not need to enter the absolute path of the command, but just enter the command name. This is because bash is often used in shell) based on the environment variable PATH configuration, the system searches for input commands in the directories of all paths. If the command exists, the file is used. If the file does not exist, the following error occurs:-bash: ls: without that file or directory, we can use the which command followed by the bash command to view the specific directory where the command execution file is stored, such as which ls output/bin/ls.
In fact, each command is only an executable file of linux. the executable file can be a binary file or a script file, when we run them, it is the same as executing some programs after the compilation and connection is complete. For a script file, we can view the specific execution process by viewing the file content, the binary file is generally an ELF binary file, which is similar to the executable file generated by the C language program compilation connection. You can use the strace command to track the system calls used during command execution, this is a great way to analyze the problem. When we start to execute a command, we are actually in the context of another process. This process is the bash process we use. It is always waiting for user input, then, based on the first parameter of the input command line from the PATH (if only one parameter name is found from the PATH, if it contains an absolute or relative PATH, it will be searched based on the current PATH) find the file. If a new process (called by the exec System) is started after it is found, the sub-process executes the command, the bash process determines whether to wait for the sub-process to complete based on whether the command is executed by another process.
After the above introduction, I started to fully learn Linux commands. Then I learned every command carefully and persisted.