Preface:
I would like to give a brief introduction to linux, but I will not talk about it to help you get started quickly. If you want to know the development history of linux, I suggest you go to Baidu encyclopedia to check it yourself, blind scan). If you are not installed, refer to it. Hey, hey! Before talking about basic linux operations, let's take a look at the basic principles of linux, including the following:
1. linux is composed of a single small program with a single purpose. It combines many small programs to complete complex tasks.
2. Everything in linux is a file.
3. The configuration files are saved in plain text format.
4. Avoid capturing user interfaces as much as possible. (Try not to interact with users, that is, when a program starts running, you do not need to perform any operations, such as the ls command and ifconfig command)
At first glance, these principles are a bit dizzy, especially the fourth principle! Don't worry. After learning it, you will know what's going on. You don't know how to remember it first.
2. Human-Computer Interaction (shell)
In linux, we have two methods to operate linux. One is the graphical interface and the other is the command line interface, in the graphical interface (GUI), we can run a program, such as xp or win7, we only need to double-click the program to execute the program, in the command line interface (CLI) to execute the corresponding command. Now that we are talking about the command, let's talk about the basic format of the command! To execute a command, I must first understand the command. Before talking about the basic command format, let's talk about the common GUI and CLI types:
GUI:
Windows
X-Window
Gnome, KDE, Xface
CLI:
Sh, bash, csh, ksh, zsh, tcsh
3. Basic command format
(1 ). before talking about the basic format of commands, let me talk about the command prompt. Some friends may ask, what is a command prompt? As you can see, we all know, on our PC, common users and administrators also have common users and administrators in linux, and different user permissions are also different. in linux, the command prompt can be used for distinguishing, as you can see, I used root as the administrator to log on. The command prompt is #. I created a new user named test and logged on as a common user. The command prompt we saw was $.
To sum up, # represents the root user, that is, the super administrator, and $ represents the common user. I will introduce the differences between root and common users below. Here we may think that the root and common users can execute different command scopes! Because, we will talk about the commands below. Here we will specifically explain that the commands that common users can execute are certainly Executable by root, but the commands that root users can execute may not be executed by normal users.
(2) The basic command format is as follows:
Command Option parameter example: ls-l/boot
Option:
Short options :-
Multiple options can be combined:-a-B (for example, ls-a-l/boot)
Long option :--
Example: chkconfig -- list
Parameters:
Command object (for example,/boot)
4. Get started with linux commands
As we have said above, the basic format of commands, let's talk about several common basic commands!
(1). ls command (list)
List
Purpose: you can list files and directories or files and directories in a specified path.
Details:
Ls Option
-L detailed information of the displayed file is displayed in long format
-H: Use "K", "M", and "G" to display the file and directory size.
-A: all files and directories
-A: all files and directories are displayed, but the current directory and upper directory are not displayed.
-D: display the directory attributes.
-I: displays inode numbers of files and directories.
-R display in reverse order
-R recursive display
(2). cd command (Change directory)
Home directory, home directory, home directory
Cd ~ USERNAME: Enter the Home Directory of the specified user
Cd-: switch back and forth between the current directory and the previous directory
For example: cd/usr/local ---> we can enter the/usr/local directory.
(3). pwd command (Printing Working directory)
Display the current directory