29 Linux commands that you must know
Although the Linux release supports a variety of graphical user interfaces, in some cases, the Linux command line interface (bash) isSimple and fast. Bash and Linux Shell are called command line interfaces.
Commands are commands used by computers to execute tasks. You can use commands to shut down the computer, or list the file list of the current directory, or the content of the current text, or display a message on the screen.
If you are a newbie and try to use the command line interface, we collect various basic Linux commands for you to learn and help you complete various tasks in various Linux distributions. Although not very detailed, it is very useful for Linux beginners, General fire, or administrators.
1. ls-List
Ls will list the content of the current working directory (file or folder), just like opening a folder in the GUI to see the content in it.
2. mkdir-Make Directory
Mkdir A common new directory
3. pwd-Print Working Directory
Pwd displays the current working directory
4. cd-Change Directory
For the session currently running on the terminal, cd Set the Given folder (or directory) to the current working directory.
5. rmdir-Remove Directory
Rmdir Delete the specified directory.
6. rm-Remove
Rm Will delete the given file or folder, you can use rm-r Recursively delete folders
7. cp-Copy
Cp Command to copy files or folders, you can use cp-r Options to recursively copy folders.
8. mv-MoVe
Mv Command to move a file or folder. 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 Used to View File Content on standard output (monitor or screen.
10. tail-print TAIL (from last)>
Tail By default, the last 10 lines of content of a given file are displayed on the standard output. You can use tail-n N Specifies the last N lines of the file to be displayed on the standard output.
11. less-print LESS
Less Print the file content by page or by window. It is very useful and efficient in viewing large files containing large amounts of text data. You can use Ctrl + FFlip forward, Ctrl + BFlip back.
12. grep
Grep" " Search for the specified string in the specified file. Grep-I" " The case sensitivity of the string is ignored during search, while grep-r" " The specified string is recursively searched in the current working directory file.
13. Find
This command searches for files matching the conditions at a given location. You can use find -Name -Name option for case-sensitive search, find -Iname To perform case-insensitive searches.
find
-iname
14.tar
The tar command can create, view, and extract tar compressed files. Tar-cvf Is to create a 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, you can also use gzip-d To extract compressed files.
16.unzip
Unzip: Decompress the gzip file. Before decompression, you can run the unzip-l command to view the file content.
17.help
-- Help lists all available commands on the terminal. You can use the-h or-help options of any command to view the specific usage of this command.
18.whatis – What is this command
Whatis A single line is used to describe the given command.
19.man – Manual
Man A manual page is displayed for the given command.
20.exit
Exit is used to end the current terminal session.
21.ping
Ping Ping the remote host (server) by sending data packets to detect network connections and server status.
22.who – Who Is logged in
Who can list the usernames currently logged on.
23.su – Switch User
Su Used to switch between different users. Super Users can switch to other users even if they do not use a password.
24.uname
Uname displays important information about the system, such as the kernel name, host name, kernel version, and processor type. You can use uname-a to view all information.
25.free – Free memory
Free displays the system's idle memory, occupied memory, and available swap memory. free-m converts the unit in the result to KB, the free-g is converted to GB.
26.df – Disk space Free
Df: view disk usage in the file system-used and available storage space of the hard disk and other storage devices. You can use df-h to display the results in a human-readable manner.
27.ps – ProcesseS
Ps displays the running processes of the system.
28.Top – TOP processes
By default, the top command displays processes that occupy a large amount of resources based on CPU usage. You can use top-u View the CPU usage ranking of a user.
29.shutdown
Shutdown is used to shut down the computer, while shutdown-r is used to restart the computer.