Commands are instructions for a computer to perform a task. You can use commands to turn off your computer, or to list the file lists of the current directory, or the contents of the current text, or to display a message on the screen.
Here are a variety of basic commands to refer to.
1, Ls-list
LS will enumerate the contents of the current working directory (file or folder)
2. mkdir make Directory
MkDir is used to create a new directory.
3. Pwd-print Working Directory
PWD Displays the current working directory
4. Cd-change Directory
For a session that is currently running in a terminal, the CD sets the given folder (or directory) to the current working directory.
5. Rmdir-remove Directory
RmDir deletes the given directory.
6, Rm-remove
RM deletes the given file or folder and can use Rm-r to recursively delete the folder.
7, Cp-copy
CP command to copy a file or folder, you can use the CP-R option to recursively copy the folder.
8, Mv-move
The MV command moves a file or folder, and if the file or folder exists in the current working directory, you can also rename the file or folder.
9. Cat-concatenate and Print files
Cat is used to view the contents of a file on a standard output (monitor or screen).
10, Tail-print tail (from the last) >
Tail default Displays the last 10 rows of a given file on standard output, you can use Tail-n N to specify that the last n rows of the file are displayed on standard output.
11, Less-print Less
Less prints the contents of a file by page or by window. It is useful and efficient to view large files that contain large amounts of text data. You can use Ctrl+f to page forward and ctrl+b to page back.
12. grep
grep searches for the specified string in the given file. Grep-i ignores the case of the string when searching, and grep-r searches for the specified string recursively in the file of the current working directory.
13. Find
This command searches for a file that matches the condition at a given location. You can use Find-name's-name option for case-sensitive searches, find-iname for case-insensitive searches.
14. Tar
The tar command can create, view, and extract tar compressed files. TAR-CVF is to create the corresponding compressed file, TAR-TVF to view the corresponding compressed file, TAR-XVF to extract the corresponding compressed file.
15. Gzip
gzip command to create and extract gzip compressed files.
16, unzip
Unzip unzip the gzip document. You can use the Unzip-l command to view the contents of a file before extracting it.
17. Help
-HELP lists all available commands at the terminal, and you can use the-H or-HELP option of the task command to view the specific usage of the command.
18, Whatis-what is the This command
Whatis will use a single line to describe the given command.
19, Man-manual
Man displays a manual page for the given command.
20. Exit
Exit is used to end the current terminal session.
21. Ping
Ping ping A remote host (server) by sending a packet, commonly used to detect network connections and server status.
22, who-who LS logged in
Who can list the currently logged in user name.
23. Su-switch User
Su is used to switch between different users. Super users can switch to other users even if they are not using a password.
24, Uname
Uname will display important information about the system, such as the kernel name, hostname, kernel version, processor, and so on, using uname-a to view all the information.
25. Free-free Memory
Free displays information such as the system's idle memory, memory consumption, available swap memory, FREE-M converts the units in the result to kilobytes, and free-g to GB.
26. Df-disk Space Free
DF View the use of disks in the file system-the hard disk used and the available storage space, and other storage devices. You can use Df-h to display the results in a human-readable way.
27, Ps-processes
The operation process of PS display system.
28, Top-top processes
The top command displays a high-volume process by default on CPU usage, and you can use Top-u to view the CPU utilization ranking of a user.
29, shutdown
Shutdown is used to shut down the computer, and shutdown-r is used to restart the computer.
Common and useful Linux commands