-h Print usage message.
-T Include a time column (HH:MM:SS).
-U Include UID column.
-t Include a timestamp column.
-u USER Filter by UID (or username)
-x Include failed exec()s
-q Add "quotemarks" around arguments. Escape quotemarks in arguments with a backslash. For tracing empty arguments or arguments that contain whitespace.
-n NAME Only print command lines matching this name (regex)
-l LINE Only print commands where arg contains this line (regex)
--max-args MAXARGS Maximum number of arguments parsed and displayed, defaults to 20
--cgroupmap MAPPATH Trace cgroups in this BPF map only (filtered in-kernel).
--mntnsmap MAPPATH Trace mount namespaces in this BPF map only (filtered in-kernel).
-P PPID Trace this parent PID only.
Trace all exec() syscalls: # execsnoop
Trace all exec() syscalls, and include timestamps: # execsnoop -t
Display process UID: # execsnoop -U
Trace only UID 1000: # execsnoop -u 1000
Trace only processes launched by root and display UID column: # execsnoop -Uu root
Include failed exec()s: # execsnoop -x
Put quotemarks around arguments. # execsnoop -q
Only trace exec()s where the filename contains "mount": # execsnoop -n mount
Only trace exec()s where argument's line contains "testpkg": # execsnoop -l testpkg
Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): # execsnoop --cgroupmap /sys/fs/bpf/test01
TIME Time of exec() return, in HH:MM:SS format.
TIME(s) Time of exec() return, in seconds.
UID User ID
PCOMM Parent process/command name.
PID Process ID
PPID Parent process ID
RET Return value of exec(). 0 == successs. Failures are only shown when using the -x option.
ARGS Filename for the exec(), followed be up to 19 arguments. An ellipsis "..." is shown if the argument list is known to be truncated.
Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool.