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

How to do Linux Command Line Analysis

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

How to carry out Linux command line analysis, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

1. Is the command line really good

The mission of programmers

Wikipedia's explanation:

Command line interface (English: command-line interface, abbreviation: CLI) is the most widely used user interface before the popularity of graphical user interface. It usually does not support the mouse. Users enter instructions through the keyboard, and the computer receives the instructions and executes them. Some people call it a character user interface (CUI).

Some people say so:

Proficiency in using the command line is a skill that is often overlooked or considered difficult to master, but in fact, it increases your flexibility and productivity as an engineer

Personal opinion:

We have seen people from different industries tear each other up in the comment area. Is it good or bad to use the command line? In fact, I think sometimes it's pointless to spend time wrestling with these problems. If you think it's useful, learn it. If you don't like it, don't watch it. When you find it's good, you can learn it if you want to learn it. As long as you are willing to start, it's never too late.

There is no absolute explanation for anything. It depends on the occasion in which it is used. It is often said that water can carry a boat, and it can also overturn it.

I don't have a lot of command lines myself, but I really envy those Daniel who use the command line very well, and they are also learning to be familiar with most of the command line, because I think it is excellent for me, at least for now.

Have you noticed that in the movie, a "super hacker" sits in front of a computer and can hack into an ultra-secure military computer within 30 seconds without touching the mouse? This is because filmmakers realize that, as human beings, they instinctively know that the only way to get a computer to work successfully is to manipulate it with a keyboard.

But I have to say that the bad part is

The command line is not very friendly to novices, so proficiency in the use of the command line is a point where a master and a novice can significantly widen the efficiency gap.

Entertainment is not friendly, you want to play games or chat, at this time, the graphical interface still has the upper hand, of course, it is also beautiful for users.

See someone say that-I just want to make the pimples disappear on the girl's face in the photo. How can I use the command line to do so?

What's good about it?

Life is too short, efficiency or efficiency?

The mouse is not suitable for fast operation, and the command line is usually simpler, easier and more direct than clicking in the menu.

Stable and transplantable

Save worry and money in development

2. Feel the efficiency

If you try to play, you can realize its efficiency.

3. Basic command line

4. You also need to know these (examples)

5. Magical top

Here I choose to introduce top separately (with a little more information)

The use of top-as one of the most commonly used and most important Linux system monitoring tools in daily management, you can dynamically observe the status of the system process and display relevant information about the processes currently being executed by the system, including process ID, memory occupancy, CPU occupancy and other default values are updated every 5 seconds, press the Q key to exit.

Enter this command on your terminal to view $top

It will appear these messages (my computer example)

The first line explains that the current system time up 29 min- has been running for 29 minutes (during which time the system has not been restarted) 2users-there are currently 2 users logged in to the system loadaverage: 0.29,0.28,0.18 load averages-the next three numbers are 1 minute, 5 minutes, 15 minutes load loadaverage- data is to check the number of active processes every 5 seconds Then the value calculated by a specific algorithm. If this number is divided by the number of logical CPU, a result higher than 5 indicates that the system is overloaded.

The second line explains Tasks: 240total, 1 running, 239 sleeping, 0 stopped, 0 zombie- system now has 240 processes, of which 1 is running, 239 are in sleep, 0 is in stoped state, and 0 is in zombie state (zombie).

The meaning of the third line explains the percentage of us- user space occupied by CPU. The percentage of sy- kernel space that occupies CPU. 0% ni-percentage of CPU occupied by processes that have changed priority 96.6% id- idle CPU% 0.0% wa-IO wait% CPU% 0.0hi-percentage of CPU occupied by hard interrupt (HardwareIRQ)

0.0si-percentage of CPU occupied by soft interrupt (SoftwareInterrupts) `

The fourth line explains 8081084 total- total physical memory (80GB) 1533752 used- total memory in use (14GB) 4966452 free- total free memory (49GB) 1580880 buff/cache- cache memory (15g)

The meaning of the fifth line explains (swap swap partition information) 0 total- total swap area (0K) 0used-total swap area used (0K) 0free-total free swap area (0K) 5930172 avail Mem- free memory (59g)

The seventh line explains (status monitoring of each process (task)) PID- process idUSER- process owner PR- process priority NI-nice value. Negative values represent high priority, and positive values represent the total amount of virtual memory used by low-priority VIRT- processes, in kb. The amount of physical memory used by the VIRT=SWAP+RESRES- process that has not been swapped, in kb. RES=CODE+DATA

SHR- shared memory size (in kb)

S-process status. D = uninterruptible sleep state R = run S = sleep T = track / stop Z = zombie process

% percentage of time spent by CPU- from last update to present CPU

% percentage of physical memory used by the MEM- process

Total CPU time used by the TIME+- process (in 100 seconds)

COMMAND- process name (command name / command line)

This is the end of the answer to the question on how to conduct Linux command line analysis. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.

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