網(wǎng)站首頁 編程語言 正文
linux或mac控制臺下輸入ps -ef | grep 關(guān)鍵字
可以查看是否有相應(yīng)的進程啟動信息中包含關(guān)鍵字。如:
ps的意思是process status,即進程狀態(tài)。在控制臺執(zhí)行man ps
命令可以查看ps命令后面的命令選項的含義如下:
The options are as follows: -A Display information about other users' processes, including those without controlling ter- minals. -a Display information about other users' processes as well as your own. This will skip any processes which do not have a controlling terminal, unless the -x option is also specified. -C Change the way the CPU percentage is calculated by using a ``raw'' CPU calculation that ignores ``resident'' time (this normally has no effect). -c Change the ``command'' column output to just contain the executable name, rather than the full command line. -d Like -A, but excludes session leaders. -E Display the environment as well. This does not reflect changes in the environment after process launch. -e Identical to -A. -f Display the uid, pid, parent pid, recent CPU usage, process start time, controlling tty, elapsed CPU usage, and the associated command. If the -u option is also used, display the user name rather then the numeric uid. When -o or -O is used to add to the display follow- ing -f, the command field is not truncated as severely as it is in other formats. -G Display information about processes which are running with the specified real group IDs. -g Display information about processes with the specified process group leaders. -h Repeat the information header as often as necessary to guarantee one header per page of information. -j Print information associated with the following keywords: user, pid, ppid, pgid, sess, jobc, state, tt, time, and command. -L List the set of keywords available for the -O and -o options. -l Display information associated with the following keywords: uid, pid, ppid, flags, cpu, pri, nice, vsz=SZ, rss, wchan, state=S, paddr=ADDR, tty, time, and command=CMD. -M Print the threads corresponding to each task. -m Sort by memory usage, instead of the combination of controlling terminal and process ID. -O Add the information associated with the space or comma separated list of keywords speci- fied, after the process ID, in the default information display. Keywords may be appended with an equals (`=') sign and a string. This causes the printed header to use the speci- fied string instead of the standard header. -o Display information associated with the space or comma separated list of keywords speci- fied. Multiple keywords may also be given in the form of more than one -o option. Key- words may be appended with an equals (`=') sign and a string. This causes the printed header to use the specified string instead of the standard header. If all keywords have empty header texts, no header line is written. -p Display information about processes which match the specified process IDs. -r Sort by current CPU usage, instead of the combination of controlling terminal and process ID. -S Change the way the process time is calculated by summing all exited children to their par- ent process. -T Display information about processes attached to the device associated with the standard input. -t Display information about processes attached to the specified terminal devices. -U Display the processes belonging to the specified real user IDs. -u Display the processes belonging to the specified usernames. -v Display information associated with the following keywords: pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem, and command. The -v option implies the -m option. -w Use 132 columns to display information, instead of the default which is your window size. If the -w option is specified more than once, ps will use as many columns as necessary without regard for your window size. When output is not to a terminal, an unlimited number of columns are always used. -X When displaying processes matched by other options, skip any processes which do not have a controlling terminal. -x When displaying processes matched by other options, include processes which do not have a controlling terminal. This is the opposite of the -X option. If both -X and -x are speci- fied in the same command, then ps will use the one which was specified last.
可見-e
和-A
的意思是一樣的,即顯示有關(guān)其他用戶進程的信息,包括那些沒有控制終端的進程。-f
顯示用戶id,進程id,父進程id,最近CPU使用情況,進程開始時間等等。
ps -ef命令含義
工作中,平時都是通過ps -ef 去進行查看系統(tǒng)上的運行的所有進程,是一個特別常用的命令;這里說下該命令的具體含義:
只執(zhí)行ps命令,默認是顯示當(dāng)前控制臺下屬于當(dāng)前用戶的進程;
參數(shù) -e? 顯示運行在系統(tǒng)上的所有進程
參數(shù) -f? 擴展顯示輸出
UID? ? ? 啟動進程的用戶
PID? ? ? 進程的進程號
PPID? ? 父進程進程號
C? ? ? ? ? cpu使用率
STIME? ?進程啟動時的系統(tǒng)時間
TTY? ? ? ?進程啟動時終端設(shè)備
TIME? ? ?運行進程需要的累積CPU時間
CMD? ?啟動程序名稱或命令
更多的ps命令可以通過 man ps 或者? ps --help all 來獲取
原文鏈接:https://manongwushuang.blog.csdn.net/article/details/83537275
相關(guān)推薦
- 2022-09-17 Golang中的包及包管理工具go?mod詳解_Golang
- 2022-12-27 C語言實現(xiàn)二叉樹鏈?zhǔn)浇Y(jié)構(gòu)的示例詳解_C 語言
- 2022-09-04 centos搭建部署docker環(huán)境的詳細步驟_docker
- 2022-09-25 Idea maven項目報錯:Unable to import maven project: See
- 2022-10-16 基于epoll的多線程網(wǎng)絡(luò)服務(wù)程序設(shè)計_C 語言
- 2023-02-26 nvidia-smi命令詳解和一些高階技巧講解_linux shell
- 2022-09-09 詳解C語言中動態(tài)內(nèi)存管理及柔性數(shù)組的使用_C 語言
- 2022-11-13 如何使用Python讀取.xlsx指定行列_python
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支