要查看CentOS Stream 8上的進程,您可以使用ps
命令結合grep
命令來過濾特定的進程。以下是一些常用的ps
命令選項和示例:
ps aux
ps -u username
ps -p pid -o pid,ppid,cmd,%cpu,%mem
其中,pid
是您要查詢的進程ID。
grep
過濾特定進程名稱:ps aux | grep process_name
這將顯示包含process_name
的所有進程的詳細信息。如果您只想查看進程名稱,而不包括grep
命令本身,可以使用:
ps aux | grep -v grep | grep process_name
ps aux | grep 'process_name*'
請注意,CentOS Stream 8是CentOS的一個實驗性版本,它可能包含尚未在穩定版中發布的軟件包和功能。因此,某些命令或選項可能與您在CentOS 8穩定版中使用的不同。