What is a shell
Shell, commonly known as shell, refers to software that provides user interface, receives user commands, and calls corresponding applications.
Shell classification
Graphical shell
Through the friendly visual interface, call the corresponding applications, such as windows operating system, UNIX like, graphical applications on Linux system, gnome, KDE, etc.
Command line shell
Call the corresponding application by entering a specific command. Such as CMD of window system, windows PowerShell; Bash of Linux system.
Know Bash
-
Using bash in Windows requires a software that simulates and integrates most of bash commands,
-
The functions of each shell are similar. Linux uses bash by default, so it mainly studies bash.
Bash common commands
PWD (print working directory) view the current directory;
CD (change directory) switch directories, such as CD etc, CD Return to the previous level directory;
LS (list) view the contents of the current directory, such as LS al;
LS - L view the contents of the current directory in list form
MKDIR (make directory) creates a directory. You can specify a path to create a directory, such as MKDIR blog;
Touch creates a file,
Cat view all the contents of the file, cat/ Path / file name
More (UNIX support) less (Linux support) page to view files, turn pages with spaces, and Q exit.
RM (remove) deletes a file, such as the RM file name
RM - RF forcibly deletes all files in the directory, - R (recursion) is a recursive deletion, - f forcibly deletes
Rmdir (remove directory) deletes folders. Only empty folders can be deleted
MV (move) move or rename files, MV index html ./ 00/00/index. html
CP (copy) copy files
Head view the first few lines of the file, such as head -g index html
Tail view the last few lines of the file, -n-f,
Tab is automatically completed. Pressing it twice in a row will display all matching contents
History view operation history
SSH Remote Password free login, such as SSH [email protected]
>And > > redirection, > overwrite, > > append, such as cat index html > log. txt;
Clear clears the current window
Curl network request,
WhoamI view current user
Weget Download
Tar decompression
The pipe symbol can connect multiple commands together, and the execution result of the last command is regarded as the parameter of the next command.
Grep matches the content, which is generally used in combination with the pipe character.