Class Start Notice : Heavy News | The Latest Full-Stack Test Development Skills Practical Guide in 2022 (Phase 3)
The linux command is a command to manage the Linux system. For a Linux system, whether it is the central processing unit, memory, disk drive, keyboard, mouse, or user, etc., are files, and the commands managed by the Linux system are the core of its normal operation, similar to the previous DOS commands.
There are two types of linux commands in the system: built-in shell commands and Linux commands.
Order | Function Description |
---|---|
Online query and help commands (2) | |
man | See command help, a dictionary of commands, and more complex info, but not very often. |
help | See help for Linux built-in commands, such as the cd command. |
File and directory manipulation commands (18) | |
ls | Quanpin list, the function is to list the content of the directory and its content attribute information. |
cd | All spell change directory, the function is to switch from the current working directory to the specified working directory. |
cp | Quanpin copy, whose function is to copy files or directories. |
find | The meaning of search is used to find the directory and the files in the directory. |
mkdir | All spell make directories, its function is to create directories. |
mv | Quanpin move, its function is to move or rename files. |
pwd | Quanpin print working directory, its function is to display the absolute path of the current working directory. |
rename | Used to rename files. |
rm | Quanpin remove, its function is to delete one or more files or directories. |
rmdir | All spells remove empty directories, the function is to delete empty directories. |
touch | Creates a new empty file, changing the timestamp attribute of an existing file. |
tree | The function is to display the contents of the directory in a tree structure. |
basename | Displays the file name or directory name. |
dirname | Displays the file or directory path. |
chattr | Change the extended attributes of the file. |
lsattr | View file extension properties. |
file | Displays the type of file. |
md5sum | Calculate and verify the MD5 value of the file. |
View file and content processing commands (21) | |
cat | All spell concatenate, the function is to connect multiple files and print to the screen output or redirect to the specified file. |
tac | tac is the reverse spelling of cat, so the function of the command is to display the contents of the file in reverse. |
more | Display file contents in pagination. |
less | Pagination to display the contents of a file, the opposite of the more command. |
head | Displays the header of the file content. |
tail | Displays the tail of the file content. |
cut | Split each line of the file by the specified delimiter and output. |
split | Split the file into different small pieces. |
paste | Merge file contents line by line. |
sort | Sort the text content of the file. |
uniq | Remove duplicate lines. oldboy |
wc | Count the number of lines, words or bytes of a file. |
iconv | The encoding format of the converted file. |
dos2unix | Convert DOS format files to UNIX format. |
diff | Quanpin difference, compare the differences of files, often used for text files. |
vimdiff | A command-line visual file comparison tool, often used for text files. |
rev | Reverse output file contents. |
grep/egrep | Filter string, the third of the Three Musketeers. |
join | Merge by same field of two files. |
tr | Replace or delete characters. |
vi/vim | Command line text editor. |
File compression and decompression commands (4) | |
tar | Pack and compress. oldboy |
unzip | unzip files. |
gzip | gzip compression tool. |
zip | Compression tool. |
Information display commands (11) | |
uname | Commands that display information about the operating system. |
hostname | Displays or sets the hostname of the current system. |
dmesg | Displays power-on information for diagnosing system failures. |
uptime | Display 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 | View system memory. |
date | Display and set the system time. |
cal | View time information such as the calendar. |
search file command (4) | |
which | Find binary commands, according to the environment variable PATH path. |
find | Traverse from disk to find a file or directory. |
whereis | Find binary commands, according to the environment variable PATH path. |
locate | Find commands from the database (/var/lib/mlocate/mlocate.db), use updatedb to update the library. |
User management commands (10) | |
useradd | Add user. |
usermod | Modify user attributes that already exist in the system. |
userdel | delete users. |
groupadd | Add user groups. |
passwd | Modify user password. |
chage | Modify the validity period of the user password. |
id | View the user's uid, gid and the user group they belong to. |
su | Switch user identity. |
visudo | Exclusive commands for editing the /etc/sudoers file. |
sudo | Execute commands previously allowed in the sudoers file as another user (default root). |
Basic network operation commands (11) | |
telnet | Log in remotely using the TELNET protocol. |
ssh | Log in remotely using the SSH encryption protocol. |
scp | Full spell secure copy, used to copy files between different hosts. |
wget | Download the file from the command line. |
ping | Test network connectivity between hosts. |
route | Displays and sets the routing table of the linux system. |
ifconfig | Commands to view, configure, enable or disable network interfaces. |
ifup | Start the network card. |
ifdown | Turn off the network card. |
netstat | Check the network status. |
ss | Check the network status. |
Deep Network Operation Commands (9) | |
nmap | Network scan command. |
lsof | The full name is list open files, which is to list the files that have been opened in the system. |
Send and receive mail. | |
mutt | Mail management commands. |
nslookup | Commands to interactively query Internet DNS servers. |
dig | Look up the DNS resolution process. |
host | Command to query DNS. |
traceroute | Track data transfer routing status. |
tcpdump | A command-line packet capture tool. |
Commands related to disks and filesystems (16) | |
mount | Mount the filesystem. |
umount | Unmount the file system. |
fsck | Check and repair the Linux file system. |
dd | Convert or copy files. |
dumpe2fs | Export ext2/ext3/ext4 file system information. |
dump | ext2/3/4 file system backup tool. |
fdisk | Disk partition commands, applicable to disk partitions under 2TB. |
parted | Disk partition command, no disk size limit, commonly used for disk partitions below 2TB. |
mkfs | Format creates a Linux file system. |
partprobe | Update the hard disk partition table information of the kernel. |
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 ext2/ext3/ext4 filesystems. |
Commands related to system permissions and user authorization (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 current valid user name, equivalent to executing the id -un command. |
who | Display the user information currently logged in to the system. |
w | Displays a list of users who have logged in to the system, and displays the commands the user is executing. |
last | Displays the user logged in to the system. |
lastlog | Displays the most recent login information of all users in the system. |
users | Displays a user list of all users currently logged into the system. |
finger | Find and display user information. |
Built-in commands and others (19) | |
echo | Print variables, or directly output the specified string |
printf | Format the result to standard output. |
rpm | Commands to manage rpm packages. |
yum | Commands to automate and simplify the management of rpm packages. |
watch | Periodically execute the given command and display the output of the command in full screen. |
alias | Set the system alias. |
unalias | Cancel the system alias. |
date | View or set the system time. |
clear | Clear the screen, referred to as clearing the screen. |
history | View command execution history. |
eject | Eject the optical drive. |
time | Calculate command execution time. |
nc | Powerful networking tools. |
xargs | Convert standard input to command line arguments. |
exec | A command that invokes and executes an instruction. |
export | Set or display environment variables. |
unset | Delete a variable or function. |
type | Used to determine whether another command is a built-in command. |
bc | Command Line Scientific Calculator |
System management and performance monitoring commands (9) | |
chkconfig | Manage Linux system boot items. |
vmstat | Virtual memory statistics. |
mpstat | Displays status statistics for each available CPU. |
iostat | Statistics system IO. |
sar | Comprehensive access to system performance data such as CPU, run queue, disk I/O, paging (swap), memory, CPU interrupts, and network. |
ipcs | Used to report the status of the inter-process communication facilities in Linux. The displayed information includes information on message lists, shared memory, and semaphores. |
ipcrm | Used to delete one or more message queues, semaphore sets, or shared memory identifiers. |
strace | Used to diagnose, debug the Linux user space tracer. We use it to monitor user space process and kernel interactions, such as system calls, signal passing, process state changes, etc. |
ltrace | The command will trace the library function calls of the process, it will show which library function is called. |
Shutdown/Restart/Logout and View System Information Commands (6) | |
shutdown | Shut down. |
halt | Shut down. |
poweroff | Turn off the power. |
logout | Exit 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 | Turn a command that was paused in the background into a continue execution (execute in the background). |
fg | Bring the command in the background to the foreground to continue running. |
jobs | See how many commands are currently running in the background. |
kill | Terminate the process. |
killall | Terminate a process by process name. |
pkill | Terminate a process by process name. |
crontab | Scheduled task command. |
ps | Shows a snapshot of the process. |
pstree | Processes are displayed in a tree view. |
nice/renice | Adjust the priority of the program to run. |
nohup | Runs the specified command ignoring the pending signal. |
pgrep | Find processes that match the criteria. |
runlevel | View the current run level of the system. |
init | Switch runlevels. |
service | Starts, stops, restarts, and shuts down system services, and also displays the current status of all system services. |
Link: https://www.cnblogs.com/bananaaa/p/7774467.html
Recommended reading:
-
Breaking news | The latest full stack test development skills practical guide in 2022 (issue 3)
-
Required for testing: 10 mainstream performance testing tools recommended
-
Common tools and test methods for interface testing (novice)
-
The most complete automated test of Postman interface on the whole network! (Rookie Raiders)
-
The most complete software testing engineer development knowledge system map in 2022!
END
Long press QR code/Wechat scan code to add author