ps
List processes. toybox
On Linux, macOS 1 Sigma rule name it
Linux
List processes. Which processes to show (-gGuUpPt selections may be comma separated lists): Which FIELDs to show. (-o HELP for list, default = -o PID,TTY,TIME,CMD)
ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]
Show 22 options
-AAll-aHas terminal not session leader-dAll but session leaders-eSynonym for -A-gIn GROUPs-GIn real GROUPs (before sgid)-pPIDs (--pid)-PParent PIDs (--ppid)-sIn session IDs-tAttached to selected TTYs-TShow threads also-uOwned by selected USERs-UReal USERs (before suid)-kSort FIELDs (-FIELD to reverse)-MMeasure/pad future field widths-nShow numeric USER and GROUP-wWide output (don't truncate fields)-fFull listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)-lLong listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)-oOutput FIELDs instead of defaults, each with optional :size and =title-OAdd FIELDS to defaults-ZInclude LABELSeveral platforms
Information about running processes.
List all running processes
ps auxIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
List all running processes including the full command string
ps auxwwIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Search for a process that matches a string (the brackets will prevent grep from matching itself)
ps aux | grep [s]tringIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
List all processes of the current user in extra full format
ps --user $(id --user) -FIdentifyTrips 3 Sigma rules: lowLocal System Accounts Discovery - MacOs by Alejandro Ortuno, oscd.community; lowLocal System Accounts Discovery Attempt - Linux by Alejandro Ortuno, oscd.community, CheraghiMilad; lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
List all processes of the current user as a tree
ps --user $(id --user) fIdentifyTrips 3 Sigma rules: lowLocal System Accounts Discovery - MacOs by Alejandro Ortuno, oscd.community; lowLocal System Accounts Discovery Attempt - Linux by Alejandro Ortuno, oscd.community, CheraghiMilad; lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Get the parent PID of a process
ps --format ppid= --pid process_idIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Sort processes by memory consumption
ps [k sizeIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Display threads for a specific process
ps -L --pid process_idIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
macOS
Information about running processes.
List all running processes
ps auxIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
List all running processes including the full command string
ps auxwwIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Search for a process that matches a string
ps aux | grep stringIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Get the parent PID of a process
ps -o ppid= -p process_idIdentify-oOutput FIELDs instead of defaults, each with optional :size and =title toybox-pPIDs (--pid) toyboxTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Sort processes by memory usage
ps -mIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad
Sort processes by CPU usage
ps -rIdentifyTrips 1 Sigma rule: lowProcess Discovery by Ömer Günal, oscd.community, CheraaghiMilad