Linux command
procs 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List all processes
procs
Search for process by name
procs [nginx]
Watch processes
procs --watch
Show tree view
procs --tree
Sort by CPU usage
procs --sortd cpu
Sort by memory usage
procs --sortd mem
Show specific columns
procs --insert [read,write]
Show processes by user
procs --or "user eq [username]"
说明
procs is a modern replacement for ps, written in Rust with enhanced output formatting. It displays process information with syntax highlighting, making output more readable. The default view shows more useful information than ps: command name, PID, user, CPU%, memory, and a truncated command line. Colors distinguish types of processes and highlight keywords. Tree view (-t) shows process hierarchy with visual indentation. This makes it easy to see parent-child relationships without piping through pstree. Watch mode (-w) provides top-like real-time updates. Combined with sorting, it helps identify resource-heavy processes. The interval is configurable. Search works by keyword matching against multiple fields: process name, command line, user. Filters provide more precise control using expressions like "cpu gt 10" or "user eq root". Configuration file (~/.config/procs/config.toml) allows customizing columns, colors, and default options.
参数
- --tree, -t
- Tree view showing parent-child relationships.
- --watch, -w
- Watch mode with auto-refresh.
- --watch-interval _SEC_
- Refresh interval in seconds.
- --sortd _COLUMN_
- Sort descending by column.
- --sorta _COLUMN_
- Sort ascending by column.
- --insert _COLUMNS_
- Add columns to display.
- --only _COLUMNS_
- Show only specified columns.
- --or _FILTER_
- Filter with OR logic.
- --and _FILTER_
- Filter with AND logic.
- --color _MODE_
- Color mode: auto, always, disable.
- --pager _MODE_
- Pager: auto, always, disable.
- --config _FILE_
- Use specific config file.
- --theme _THEME_
- Color theme.
- --no-header
- Hide column headers.
FAQ
What is the procs command used for?
procs is a modern replacement for ps, written in Rust with enhanced output formatting. It displays process information with syntax highlighting, making output more readable. The default view shows more useful information than ps: command name, PID, user, CPU%, memory, and a truncated command line. Colors distinguish types of processes and highlight keywords. Tree view (-t) shows process hierarchy with visual indentation. This makes it easy to see parent-child relationships without piping through pstree. Watch mode (-w) provides top-like real-time updates. Combined with sorting, it helps identify resource-heavy processes. The interval is configurable. Search works by keyword matching against multiple fields: process name, command line, user. Filters provide more precise control using expressions like "cpu gt 10" or "user eq root". Configuration file (~/.config/procs/config.toml) allows customizing columns, colors, and default options.
How do I run a basic procs example?
Run `procs` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --tree, -t do in procs?
Tree view showing parent-child relationships.