Home>Article>Operation and Maintenance> The latest summary! 150 essential commands for Linux operations!
There are two types in the system: built -in shell commands and linux commands. [Recommended:Linux Video Tutorial]
Command | Function description |
---|---|
##Online query and help commands (2 ) | |
View command help, dictionary of commands, and more complex ones There is also info, but it is not commonly used. | |
View help for Linux built-in commands, such as the cd command. | |
Quan spelling list, the function is to list the contents of the directory and its content attribute information. | |
Quanpin change directory, the function is to switch from the current working directory to the specified working directory. | |
Quan spelling copy, its function is to copy files or directories. | |
find means, used to find directories and files under the directories. | |
Quanpin make directories, its function is to create directories. | |
Quan spell move, its function is to move or rename files. | |
Quanpin print working directory, its function is to display the absolute path of the current working directory. | |
is used to rename files. | |
Quanpin remove, its function is to delete one or more files or directories. | |
Quanpin remove empty directories, the function is to delete empty directories. | |
#Create a new empty file and change the timestamp attribute of the existing file. | |
The function is to display the contents of the directory in a tree structure. | |
Display the file name or directory name. | |
Display the file or directory path. | |
Change the extended attributes of the file. | |
View file extension attributes. | |
Displays the type of file. | |
Calculate and verify the MD5 value of the file. | |
The full spelling of concatenate is used to connect multiple files and print to the screen or redirect to a specified file. | |
tac is the reverse spelling of cat, so the function of the command is to display the file contents in reverse. | |
Display the file contents in pages. | |
Display the file contents in pages, the opposite usage of the more command. | |
Display the header of the file content. | |
Display the tail of the file content. | |
Split each line of the file according to the specified delimiter and output it. | |
Split the file into different small fragments. | |
Merge file contents line by line. | |
Sort the text content of the file. | |
Remove duplicate rows. oldboy | |
# Counts the number of lines, words, or bytes of the file. | |
Convert the encoding format of the file. | |
Convert DOS format files to UNIX format. | |
Full spelling difference, compares the differences of files, often used for text files. | |
Command-line visual file comparison tool, commonly used for text files. | |
Reverse output file content. | |
Filter strings, the third of the Three Musketeers. | |
Merge by the same fields of the two files. | |
Replace or delete characters. | |
Command line text editor. | |
Package and compress. oldboy | |
Unzip the file. | |
gzip compression tool. | |
Compression tool. | |
uname | Command to display operating system related information. |
hostname | Display or set the host name of the current system. |
dmesg | Displays boot information and is used to diagnose system faults. |
uptime | Displays system running time and load. |
stat | Displays the status of a file or file system. |
du | Calculate disk space usage. |
df | Reports file system disk space usage. |
top | Real-time display of system resource usage. |
free | Check the system memory. |
date | Display and set the system time. |
cal | View calendar and other time information. |
Search file commands (4) | |
##which | To search for binary commands, search according to the path of the environment variable PATH.|
find | Traverse the disk to find a file or directory.|
whereis | Find the binary command and search according to the path of the environment variable PATH.|
locate | Find the command from the database (/var/lib/mlocate/mlocate.db) and update the library using updatedb.|
User management commands (10) | |
Add user. | |
Modify the user attributes that already exist in the system. | |
Delete user. | |
Add user group. | |
Change user password. | |
Change the user password validity period. | |
View the user's uid, gid and user group to which they belong. | |
Switch user identity. | |
Exclusive command to edit the /etc/sudoers file. | |
Execute commands previously allowed in the sudoers file as another user (default root user). | |
Use TELNET protocol to log in remotely. | |
Use SSH encryption protocol to log in remotely. | |
Secure copy is used to copy files between different hosts. | |
Command line download file. | |
Test the network connectivity between hosts. | |
Display and set the routing table of the linux system. | |
Commands to view, configure, enable, or disable network interfaces. | |
Start the network card. | |
Close the network card. | |
Check the network status. | |
Check the network status. | |
Network scanning command. | lsof |
Full name list open files, which is to list the files that have been opened in the system. | |
Send and receive emails. | mutt |
Mail management commands. | nslookup |
Command to interactively query Internet DNS servers. | dig |
Find the DNS resolution process. | host |
Command to query DNS. | traceroute |
Trace the data transmission routing status. | tcpdump |
Command line packet capture tool. | Commands related to disk and file system (16) |
mount | Mount the file system. |
umount | Unmount the file system. |
fsck | Check and repair Linux file systems. |
dd | Convert or copy files. |
dumpe2fs | Export ext2/ext3/ext4 file system information. |
dump | ext2/3/4 file system backup tool. |
fdisk | Disk partition command, suitable for disk partitions below 2TB. |
parted | Disk partition command has no disk size limit and is commonly used for disk partitions below 2TB. |
mkfs | Format and create a Linux file system. |
partprobe | Update the kernel’s hard disk partition table information. |
e2fsck | Check ext2/ext3/ext4 type file system. |
mkswap | Create a Linux swap partition. |
swapon | Enable swap partition. |
swapoff | Close the swap partition. |
sync | Write the data in the memory buffer to disk. |
resize2fs | Resize the ext2/ext3/ext4 file system. |
System permissions and user authorization related commands (4) | |
##chmod | Change file or directory permissions.|
chown | Change the owner and group of a file or directory.|
chgrp | Change the file user group.|
umask | Display or set the permission mask.|
Commands to view system user login information (7) | |
whoami | Displays the currently valid user name, which is equivalent to executing the id -un command.|
who | Displays the user information currently logged in to the system.|
w | Displays the list of users who have logged in to the system and displays the instructions that the user is executing.|
last | Displays the users logged into the system.|
lastlog | Displays the latest login information of all users in the system.|
users | Displays the user list of all users currently logged in to the system.|
finger | Find and display user information.|
Built-in commands and others (19) | |
Print variables, or directly output the specified string | |
Format the result and output it to standard output. | |
Command to manage rpm packages. | |
Automate and simplify the commands for managing rpm packages. | |
Periodically execute the given command and display the command output in full screen mode. | |
Set the system alias. | |
Cancel system alias. | |
View or set the system time. | |
Clear the screen, referred to as clear screen. | |
View the history of command execution. | |
Eject the optical drive. | |
Calculate the command execution time. | |
Powerful network tool. | |
Convert standard input into command line arguments. | |
The command that calls and executes the instruction. | |
Set or display environment variables. | |
Delete a variable or function. | |
is used to determine whether another command is a built-in command. | |
Command line scientific calculator | |
chkconfig | Manage Linux system startup items. |
vmstat | Virtual memory statistics. |
mpstat | Display status statistics of each available CPU. |
iostat | Statistics system IO. |
sar | Comprehensively obtain the system’s CPU, run queue, disk I/O, paging (swap area), memory, and CPU interrupts and network performance data. |
ipcs | is used to report the status of inter-process communication facilities in Linux. The information displayed includes message lists, shared memory and semaphores. information. |
ipcrm | Used to delete one or more message queues, semaphore sets or shared memory identifiers. |
strace | is used to diagnose and debug Linux user space tracer. We use it to monitor the interaction between user space processes and the kernel, such as system calls, signal transmission, process state changes, etc. The |
ltrace | command will trace the library function calls of the process, and it will show which library function is called. |
Commands to shut down/restart/log off and view system information (6 commands) | |
shutdown | Shut down. |
halt | Shut down. |
poweroff | Turn off the power. |
logout | Quit the currently logged in Shell. |
exit | Exit the currently logged in Shell. |
Ctrl d | Shortcut key to exit the currently logged in Shell. |
Process management related commands (15) | |
bg | Convert a command that is paused in the background to continue execution (execute in the background). |
fg | Move the command in the background to the foreground to continue running. |
jobs | Check how many commands are currently running in the background. |
kill | Terminate the process. |
killall | Kill the process by its name. |
pkill | Kill the process by its name. |
crontab | Scheduled task command. |
ps | Displays a snapshot of the process. |
pstree | Tree display process. |
nice/renice | Adjust the priority of program running. |
nohup | Ignore the hang signal and run the specified command. |
pgrep | Find processes matching the conditions. |
runlevel | View the current running level of the system. |
init | Switch run levels. |
service | Start, stop, restart and shut down system services, and also display the current status of all system services. |
This article is reprinted, original address: https://learnku.com/articles/68614
The above is the detailed content of The latest summary! 150 essential commands for Linux operations!. For more information, please follow other related articles on the PHP Chinese website!