中文字幕亚洲第一精品|精品国产免费一区二区|久久婷婷五月六月综合版|中文字幕熟妇久久久人妻|久久综合精品国产一区无码|国产成人精品永久免费视频|午夜亚洲国产精品理论片a级|久久精品一区二区三区无码护土

 訪問手機版  

Linux常用命令|Linux培訓學習|考試認證|工資待遇與招聘,認準超級網工!

招聘|合作 登陸|注冊

網絡工程師培訓

當前位置:網絡工程師 > 技術課程 > linux > 熱點關注 > linux常用命令

Linux ps 命令查看進程啟動及運行時間

時間:2019-07-23

linux解壓命令_linux命令windows命令_linux命令

Linux ps 命令查看進程啟動及運行時間

同事問我怎樣看一個進程的啟動時間和運行時間,我第一反應當然是說用 ps 命令啦。

ps aux或ps -ef不就可以看時間嗎?

我們來重新復習下ps aux的選項,這是類 BSD 風格的命令選項,因為不帶“-”。

通過 man 可以看到 aux 選項解釋如下:

linux解壓命令_linux命令windows命令_linux命令

a      Lift the BSD-style "only yourself" restriction, which is imposed upon the set of all processes 
when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like.  
The set of processes selected in this manner is in addition to the set of processes selected by other means.
An alternate description is that this option causes ps to list all processes with a terminal (tty), 
or to list all processes when used together with the x option.
x      Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes 
when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like.  
The set of processes selected in this manner is in addition to the set of processes selected by other means.  
An alternate description is that this option causes ps to list all processes owned by you (same EUID as ps), 
or to list all processes when used together with the a option.
u      Display user-oriented format.
              

然后再來看下ps aux的輸出結果,其首行如下,說明了輸出的各列:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND

我們可以看到START和TIME列l(wèi)inux命令,通過 man 其說明如下:

bsdstart    START     time the command started.  
If the process was started less than 24 hours ago, the output format is " HH:MM", 
else it is " Mmm:SS" (where Mmm is the three letters of the month). 
See also lstart, start, start_time, and stime.
bsdtime     TIME      accumulated cpu time, user + system.  
The display format is usually "MMM:SS", 
but can be shifted to the right if the process used more than 999 minutes of cpu time.