166 most commonly used Linux commands, which ones do you not know?

The linux command is a command to manage the Linux system. For the Linux system, whether it is the central processing unit, memory, disk drive, keyboard, mouse, or user, etc. are all files, the commands managed by the Linux system are the core of its normal operation.

Online query and help commands (2)

man: View command help, command dictionary, and more complicated info, but not commonly used.

help: View the help of Linux built-in commands, such as the cd command.

File and directory operation commands (18)

ls: Quanpin list, the function is to list the content of the directory and its content attribute information.

cd: Quanpin change directory, the function is to switch from the current working directory to the specified working directory.

cp: Quanpin copy, its function is to copy files or directories.

find: Find means to find the directory and the files under the directory.

mkdir: Quanpin 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: full spell remove empty directories, the function is to delete empty directories.

touch: Create a new empty file and change the timestamp attribute of an existing file.

tree: The function is to display the contents of the directory in a tree structure.

basename: Display 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 attributes.

file: Displays the type of the file.

md5sum: Calculate and check the MD5 value of the file.

View files and content processing commands (21)

cat: full spell concatenate, the function is to connect multiple files and print to the screen output or redirect to the specified file.

tactac: It is the reverse spelling of cat, so the function of the command is to display the contents of the file in reverse.

more: display the contents of the file in pages.

less: display the contents of the file in pages, and the opposite usage 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.

wc: Count the number of lines, words or bytes of a file.

iconv: Convert the encoding format of the file.

dos2unix: Convert DOS format files to UNIX format.

diff: spell difference, compare file differences, often used in text files.

vimdiff: A command-line visual file comparison tool, often used for text files.

rev: output the contents of the file in reverse.

grep/egrep: Filter strings, the third of the Three Musketeers.

join: Merge two files by the same fields.

tr: replace or delete characters.

vi/vim: A command-line text editor.

File compression and decompression commands (4)

tar: Pack and compress. old boy

unzip: Unzip the file.

gzipgzip: compression tool.

zip: compression tool.

Information display commands (11)

uname: A command to display information about the operating system.

hostname: Display or set the hostname of the current system.

dmesg: Display boot information for diagnosing system failures.

uptime: Display the system running time and load.

stat: Displays the status of a file or file system.

du: Calculate disk space usage.

df: Reports the usage of file system disk space.

top: Display system resource usage in real time.

free: View system memory.

date: display and set the system time.

cal: View calendar and other time information.

Search file commands (4)

which: Find binary commands, search according to the environment variable PATH path.

find: Traverse to find files or directories from disk.

whereis: Find binary commands, search according to the environment variable PATH path.

locate: Find commands from the database (/var/lib/mlocate/mlocate.db), and use updatedb to update the library.

User management commands (10)

useradd: Add users.

usermod: Modify the existing user attributes in the system.

userdel: delete a user.

groupadd: Add user group.

passwd: Modify user password.

chage: Change the validity period of the user password.

id: View the user's uid, gid and user group to which they belong.

su: switch user identity.

visudo: Exclusive command for editing the /etc/sudoers file.

sudo: Execute the commands allowed in the sudoers file in advance as another user (default root user).

Basic network operation commands (11)

telnet: Use the TELNET protocol to log in remotely.

ssh: Remote login using the SSH encryption protocol.

scp: full spell secure copy, used to copy files between different hosts.

wget: Download files from the command line.

ping: Test the connectivity of the network between hosts.

route: Display and set the routing table of the linux system.

ifconfig: Commands to view, configure, enable, or disable network interfaces.

ifup: Start the network card.

ifdown: close the network card.

netstat: View network status.

ss: View network status.

In-depth network operation commands (9)

nmap: Network scanning command.

lsof: full name list open files, which is to list the files that have been opened in the system.

mail: Send and receive mail.

mutt: mail management command.

nslookup: A command to interactively query Internet DNS servers.

dig: Find the DNS resolution process.

host: command to query DNS.

traceroute: Track data transmission routing status.

tcpdump: A packet capture tool for the command line.

Commands about disks and file systems (16)

mount: mount the file system.

umount: Unmount the file system.

fsck: Check and repair Linux filesystems.

dd: Convert or copy files.

dumpe2fs: Export ext2/ext3/ext4 file system information.

dumpe: xt2/3/4 file system backup tool.

fdisk: disk partition command, suitable for disk partitions below 2TB.

parted: disk partition command, no disk size limit, often used for disk partitions below 2TB.

mkfs: format to create 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: Turn off the swap partition.

sync: Write the data in the memory buffer to disk.

resize2fs: Adjust the size of 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 into the system.

w: Display the list of users who have logged in to the system, and display the commands the users are executing.

last: Displays the users logged in to the system.

lastlog: Displays the latest 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: command to manage rpm packages.

yum: The command 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 clear screen.

history: View the history of command execution.

eject: eject the CD-ROM drive.

time: Calculate command execution time.

nc: a powerful network tool.

xargs: Convert standard input into command-line arguments.

exec: A command to invoke and execute 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 startup items.

vmstat: virtual memory statistics.

mpstat: Display the status statistics of each available CPU.

iostat: statistics system IO.

sar: comprehensively obtain performance data such as CPU, run queue, disk I/O, paging (swap area), memory, CPU interrupt, and network of the system.

ipcs: Used to report the status of the inter-process communication facility in Linux. The displayed information includes message list, shared memory and semaphore information.

ipcrm: Used to delete one or more message queues, semaphore sets, or shared memory identifiers.

strace: Used to diagnose and debug Linux user space tracers. We use it to monitor the interaction between userspace processes and the kernel, such as system calls, signal delivery, process state changes, etc.

ltrace: The command will track the library function calls of the process, and it will show which library function is called.

Commands for shutdown/restart/logout and viewing system information (6)

shutdown: shutdown.

halt: shutdown.

poweroff: Turn off the power.

logout: Exit the currently logged in Shell.

exit: Exit the currently logged in Shell.

Ctrl+d: The shortcut key to exit the currently logged in Shell.

Process management related commands (15)

bg: Change a command suspended in the background to continue execution (executed in the background).

fg: Bring the commands in the background to the foreground to continue running.

jobs: View how many commands are currently running in the background.

kill: terminate the process.

killall: Terminates a process by process name.

pkill: Terminate a process by process name.

crontab: Timing task command.

ps: Displays a snapshot of the process.

pstree: tree display process.

nice/renice: Adjust the priority of program running.

nohup: Run the specified command ignoring the hangup signal.

pgrep: Find processes matching criteria.

runlevel: Check the current running level of the system.

init: switch run level.

service: Start, stop, restart and close system services, and also display the current status of all system services.

at last

Pay attention to the official account: Programmer Chasing the Wind. Reply 003 Get the latest 2020 Java interview question manual (more than 200 pages of PDF documents)

 

Guess you like

Origin blog.csdn.net/Design407/article/details/108984520