59
$ ps -Awwo pid,comm,args
  PID COMMAND         COMMAND
    1 init            /sbin/init
    2 kthreadd        [kthreadd]
    3 ksoftirqd/0     [ksoftirqd/0]
    5 kworker/u:0     [kworker/u:0]
    6 migration/0     [migration/0]
    7 cpuset          [cpuset]
    8 khelper         [khelper]
    9 netns           [netns]
   10 sync_supers     [sync_supers]
   11 bdi-default     [bdi-default]
   12 kintegrityd     [kintegrityd]
   13 kblockd         [kblockd]
   14 kacpid          [kacpid]
   15 kacpi_notify    [kacpi_notify]
   16 kacpi_hotplug   [kacpi_hotplug]
   17 ata_sff         [ata_sff]
   18 khubd           [khubd]

What do the brackets mean? Does args always return the full path to the process command (e.g. /bin/cat)?

49

Brackets appear around command names when the arguments to that command cannot be located.

The ps(1) man page on FreeBSD explains why this typically happens to system processes and kernel threads:

If the arguments cannot be located (usually because it has not been set, as is the case of system processes and/or kernel threads) the command name is printed within square brackets.

The ps(1) man page on Linux states similarly:

Sometimes the process args will be unavailable; when this happens, ps will instead print the executable name in brackets.

  • 1
    What does the args not being available have to do with not printing full path to the process command (/bin/cat)? I thought args are the arguments passed after the command. (Although the command itself indeed shows up in argv - I don't quite understand, I thought of it as a convenience feature.) – n611x007 Nov 24 '13 at 21:26
14

From the manual:

Sometimes the process args will be unavailable; when this happens, ps will instead print the executable name in brackets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.