Method: 1. Set the "-w" parameter of the top command, the syntax is "top -parameter-w..."; 2. Set the "-c" parameter of the top command, this parameter can switch the results The display mode can display the complete path and name in the result, and the syntax is "top -c".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The Linux top command is used to display the dynamics of the process in real time.
Usage permissions: all users.
Syntax
top [-] [d delay] [q] [c] [S] [s] [i] [n] [b]
Parameter description:
d: Change the display update speed, or press s in the interactive command bar (interactive command)
q: Display speed without any delay. If the user has superuser permissions, top will be executed with the highest priority
c: Switch the display mode, there are two modes, one is to display only the name of the executable file, the other is to display the complete path and name
#S: Accumulation mode, will Accumulate the CPU time of completed or disappeared child processes (dead child processes)
s: Safe mode, cancel conversational instructions to avoid potential crises
i: Do not display any idle or useless processes
n: Number of updates, top will be exited after completion
b: Batch file mode, used with the "n" parameter, can be used to output the top results to the file
The example is as follows: Use python's paramiko to obtain the top information of Linux
The command is:
top -b -n 1
-b is the batch mode, -n is the number of refreshes
1. It is found that the information is not displayed completely. Finally, man top, after adding a parameter w, it will be fully displayed
top -b -n 1 -w 512
2. If you need to display the complete COMMAND command, use the top -c parameter
top -c
Recommended learning:Linux video tutorial
The above is the detailed content of What to do if the top command in Linux is not fully displayed. For more information, please follow other related articles on the PHP Chinese website!