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 commands for getting started with Linux to improve productivity

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "what Linux entry to improve work efficiency commands", the explanation content in the article is simple and clear, easy to learn and understand, please follow the small series of ideas slowly in-depth, together to study and learn "what Linux entry to improve work efficiency commands" bar!

DF command

Used to view the status information of Linux file system, displaying the capacity, used amount, unused amount and mount point of each partition. For example:

df -k Displays information about each partition in kilobytes (KB);

df -a Displays all partitions, including partitions with size 0;

df -T Displays the partition type (EXT2 or EXT3, etc.).

This command is very convenient to view partition usage, and so on, do not have to find disk management so troublesome. One day found a file copy failed, df a look, oh, no space.

du command

df view partition capacity, there must be a view file size information command, right, is du command. Use to view the size of a file or folder. For example:

du -b /home Displays the size of each subfolder under the " /home " folder in bytes;

du -ks home Displays the total size of the "/home" folder in kilobytes (KB);

ls can also get file sizes, but ls is not as convenient as du.

top command

God, suddenly found that the computer response is very slow, what the hell. Then the top order came. top is used to view system status information in real time. After running this command, the following message appears on the screen:

CPU states: including user process occupancy ratio, system process occupancy ratio, user nice priority process occupancy ratio and idle CPU resource ratio;

Memory status (Mem): including the total amount of memory, usage, free amount, etc.;

Swap partition status: including the total number of swap partitions, usage, idle amount, etc.;

The state of each process: including the process ID, username, priority, CPU and memory usage, and the command line executed when running the process;

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 every 1 second.

After entering top, press the following buttons to have corresponding functions:

[Blank] Refresh the display information immediately;

[M] Sort by memory usage;

[N] Sort by process ID;

[P] Sort by CPU usage;

[c] Expand the command line information to display the complete command line;

【?】Display help information;

[Q] Exit the top program.

the iostat command

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

iostat -c Displays CPU usage statistics only;

iostat -d Displays device/partition usage statistics only;

iostat -d 2 counts device/partition usage and refreshes every 2 seconds;

In the IO statistics displayed, each part is described as follows:

The number of IO transfer requests received per second by the tps device;

Blk_read/s Number of blocks read per second by the device;

Blk_wrtn/s Number of blocks written per second by the device;

Blk_read Total number of blocks read by device;

Blk_wrtn Total number of blocks written by device;

The CPU statistics displayed have the same meaning as top.

Thank you for reading, the above is "what Linux entry to improve efficiency of the command" content, after the study of this article, I believe that we have what Linux entry to improve efficiency of the command this issue has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

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

Servers

Wechat

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

12
Report