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 are the most efficient commands commonly used under Linux

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

Share

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

This article mainly introduces what are the commonly used efficient commands under Linux, which are introduced in great detail and have certain reference value. Friends who are interested must finish reading them.

Linux provides a large number of commands, which can effectively complete a lot of work, such as disk operation, file access, directory operation, process management, file permission setting and so on. Therefore, working on a Linux system is inseparable from using the commands provided by the system.

Df command

Used to view the status information of the Linux file system, showing the capacity, usage, unusage, mount point and other information of each partition. Such as:

Df-k displays information about each partition in kilobytes (KB); df-a displays all partitions, including partitions of size 0; df-T shows the partition type (EXT2 or EXT3, etc.). This command is very convenient to check the partition usage, and there is no need to find disk management so troublesome. One day I found that a copy of a file failed, and df looked, Oh, there was no space. Du command

Df to check the partition capacity, there must be a command to view file size information, yes, it is the du command. Used to view the size of a file or folder. Such as:

Du-b / home displays the size of the subfolders under the "/ home" folder in bytes; du-ks home displays the total size of the "/ home" folder in kilobytes (KB); ls can also get the file size, but ls is not as convenient as du. Top command

Oh, my God, I suddenly found that the computer is very slow. What's wrong with it? So here comes the top command. Top is used to view system status information in real time. After running the command, the following information is displayed on the screen:

CPU status (CPU states): including user process occupancy ratio, system process occupancy ratio, user nice priority process occupancy ratio and free CPU resource ratio, etc.; memory status (Mem): including total memory, usage, free, etc.; swap partition status (Swap): including total swap partition, usage, free, etc. The status of each process: including process ID, user name, priority, CPU and memory usage, as well as the command line executed when the process is run; after executing the top command, the system will automatically refresh the status information every 5 seconds. If you want to specify the refresh interval, add the "- d" parameter at startup. For example, top-d 1 starts top and refreshes it every 1 second. After entering top, pressing the following button will have the corresponding function: [space] immediately refreshes the display information; [M] sorts by memory usage; [N] sorts by process ID; [P] sorts by CPU usage; [c] expands command line information to display complete command line; [?] displays help information; [Q] exits top program. Iostat command

Similarly, iostat is a command that displays system information classes, which counts and outputs CPU usage information and IO information for specific devices or partitions. For example:

Iostat-c displays only CPU usage statistics; iostat-d only displays device / partition usage statistics; iostat-d 2 counts device / partition usage and is refreshed every 2 seconds; the displayed IO statistics are described as follows: the number of IO transfer requests received by tps devices per second; the number of blocks read by Blk_read/s devices per second; and the number of blocks written by Blk_wrtn/s devices per second The total number of blocks read by the Blk_read device, the total number of blocks written by the Blk_wrtn device, and the meaning of each part of the displayed CPU statistics is the same as top. The above is all the contents of the article "what are the most efficient commands commonly used under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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