Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the most commonly used Linux command?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, I'll tell you what the most commonly used Linux commands are. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

The linux command is a command that manages the Linux system. For the Linux system, no matter the CPU, memory, disk drive, keyboard, mouse, or users are all files, the command managed by the Linux system is the core of its normal operation.

Online query and help commands (2)

Man: check command help, command dictionaries, and, more complex, info, but not often.

Help: check out the help for Linux built-in commands, such as the cd command.

File and directory operation commands (18)

Ls: full spelling list, the function is to list the contents of the directory and its content attribute information.

Cd: full spelling change directory, the function is to switch from the current working directory to the specified working directory.

Cp: full spelling copy, its function is to copy files or directories.

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

Mkdir: full spelling make directories, its function is to create a directory.

Mv: full spelling move, whose function is to move or rename files.

Pwd: full spelling print working directory, whose function is to display the absolute path of the current working directory.

Rename: used to rename files.

Rm: full spelling remove, whose function is to delete one or more files or directories.

Rmdir: full spelling remove empty directories, the function is to delete empty directories.

Touch: create a new empty file and change the timestamp attribute of the 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 properties 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: full spelling concatenate, the function is to connect multiple files and print to the screen output or redirect to the specified file.

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

More: displays the contents of the file in pages.

Less: displays the contents of the file in paging, the opposite use of the more command.

Head: the header that displays the contents of the file.

Tail: displays the tail of the file contents.

Cut: splits and outputs each line of the file according to the specified delimiter.

Split: split the file into different small pieces.

Paste: merge the contents of the file by line.

Sort: sorts the text contents of a file.

Uniq: remove duplicate lines.

Wc: count the number of lines, words, or bytes of a file.

Iconv: converts the encoding format of the file.

Dos2unix: converts DOS format files to UNIX format.

Diff: full spelling difference, comparing the differences of files, often used in text files.

Vimdiff: command line visual file comparison tool, often used for text files.

Rev: output the contents of the file in reverse.

Grep/egrep: filter strings, three Musketeers third.

Join: merge by the same field of two files.

Tr: replace or delete characters.

Vi/vim: command line text editor.

File compression and decompression commands (4)

Tar: package and compress. Oldboy

Unzip: extract the file.

Gzipgzip: compression tool.

Zip: compression tool.

Information display commands (11)

Uname: a command that displays information about the operating system.

Hostname: displays or sets the hostname of the current system.

Dmesg: displays boot information for diagnosing system faults.

Uptime: displays the system running time and load.

Stat: displays the status of the file or file system.

Du: calculates disk space usage.

Df: reports the disk space usage of the file system.

Top: displays the usage of system resources in real time.

Free: view system memory.

Date: displays and sets the system time.

Cal: view calendar and other time information.

Search file commands (4)

Which: find the binary command by the path of the environment variable PATH.

Find: traverses from disk to find files or directories.

Whereis: find the binary command by the path of the environment variable PATH.

Locate: find commands from the database (/ var/lib/mlocate/mlocate.db) and update the library using updatedb.

Summary of previous periods: 001 ~ 150

User management commands (10)

Useradd: add users.

Usermod: modify user attributes that already exist in the system.

Userdel: delete the user.

Groupadd: add a user group.

Passwd: change the user's password.

Chage: the validity period for changing a user's password.

Id: view the uid,gid of the user and the user group to which he belongs.

Su: switch user identity.

Visudo: exclusive command for editing the / etc/sudoers file.

Sudo: execute commands that are previously allowed in the sudoers file as another user (the default root user).

Basic network operation commands (11)

Telnet: log in remotely using the TELNET protocol.

Ssh: log in remotely using the SSH encryption protocol.

Scp: fully spelled secure copy, used to copy files between different hosts.

Wget: download the file on the command line.

Ping: test the connectivity of the network 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: view the network status.

Ss: view the network status.

Deep network operation commands (9)

Nmap: network scan command.

Lsof: full name list open files, which enumerates the files that have been opened in the system.

Mail: send and receive mail.

Mutt: Mail management commands.

Nslookup: the command to interactively query the Internet DNS server.

Dig: find the DNS parsing process.

Host: the command to query DNS.

Traceroute: tracks the routing of data transfers.

Tcpdump: command line tool for grabbing packages.

Commands about disks and file systems (16)

Mount: Mount the file system.

Umount: unmount the file system.

Fsck: check and repair the Linux file system.

Dd: convert or copy files.

Dumpe2fs: exports ext2/ext3/ext4 file system information.

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

Fdisk: disk partition command, which applies to the following disk partitions of 2TB.

Parted: disk partition command, which has no disk size limit and is commonly used for the following disk partitions of 2TB.

Mkfs: format to create a Linux file system.

Partprobe: update the hard disk partition table information of the kernel.

E2fsck: check the ext2/ext3/ext4 type file system.

Mkswap: create a Linux swap partition.

Swapon: enables swap partitions.

Swapoff: turn off the swap partition.

Sync: writes data in the memory buffer to disk.

Resize2fs: resize the ext2/ext3/ext4 file system.

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: displays or sets 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 that is currently logged in to the system.

W: displays a list of users who have logged in to the system and displays the instructions that the user is executing.

Last: displays the users who have logged in to the system.

Lastlog: displays the last login information of all users in the system.

Users: displays a list of all users currently logged into the system.

Finger: find and display user information.

Built-in commands and other (19)

Echo: print a variable, or output a specified string directly

Printf: formats the result to standard output.

Rpm: command to manage rpm packages.

Yum: commands to automate and simplify the management of rpm packages.

Watch: periodically executes a given command and displays the output of the command in full screen.

Alias: sets the system alias.

Unalias: cancel the system alias.

Date: view or set the system time.

Clear: clear screen, or clear screen for short.

History: view the history of command execution.

Eject: eject the optical drive.

Time: calculates the execution time of the command.

Nc: a powerful network tool.

Xargs: converts standard input to command-line arguments.

Exec: a command that invokes and executes instructions.

Export: sets or displays environment variables.

Unset: deletes a variable or function.

Type: used to determine whether another command is a built-in command.

Bc: command line science calculator.

Summary of previous periods: 001 ~ 150

System management and performance monitoring commands (9)

Chkconfig: manages the boot entry of the Linux system.

Vmstat: virtual memory statistics.

Mpstat: displays status statistics for each available CPU.

Iostat: statistical system IO.

Sar: comprehensive access to system performance data such as CPU, run queue, disk Imax O, paging (swap area), memory, CPU interrupts, and network.

Ipcs: used to report the status of interprocess communication facilities in Linux, displaying information including message lists, shared memory, and semaphores.

Ipcrm: used to delete one or more message queues, semaphores, or shared memory identities.

Strace: used to diagnose and debug the Linux user space tracker. We use it to monitor the interaction between user-space processes and the kernel, such as system calls, signaling, process state changes, and so on.

Ltrace: the command tracks the library function calls of the process, and it shows which library function is called.

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

Shutdown: turn it off.

Halt: turn it off.

Poweroff: turn off the power.

Logout: log out of the currently logged in Shell.

Exit: log out of 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 that is paused in the background to continue execution (execution in the background).

Fg: transfer the commands in the background to the foreground to continue to run.

Jobs: see how many commands are currently running in the background.

Kill: terminates the process.

Killall: terminates the process by its name.

Pkill: terminates the process by its name.

Crontab: scheduled task command.

Ps: displays a snapshot of the process.

Pstree: displays the progress in a tree.

Nice/renice: adjust the priority of the program to run.

Nohup: runs the specified command ignoring the suspend signal.

Pgrep: the process of finding matching criteria.

Runlevel: view the current running level of the system.

Init: switch the runlevel.

Service: starts, stops, restarts, and shuts down system services, and also displays the current status of all system services.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

These are all of the most commonly used Linux commands, and more related to the most commonly used Linux commands can be searched for previous articles or browse the following articles to learn ha! I believe the editor will add more knowledge to you. I hope you can support it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report