86
$ 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)?

5
  • 6
    my arch-nemesis, user626201, has already asked this question on stackoverflow stackoverflow.com/questions/7078258/…
    – joslinm
    Commented Oct 5, 2011 at 22:09
  • 4
    Yes, those are usually kernel threads. Commented Oct 5, 2011 at 22:23
  • 4
    When would they not be kernel threads? When are "process args unavailable"?
    – mgalgs
    Commented May 1, 2013 at 17:00
  • 1
  • I think most people would have just been happy not seeing any arguments in the ps list. Square brackets add confusion and should have been reserved for kernel threads because that's what everyone initially thinks it means...
    – Brain2000
    Commented Feb 16, 2023 at 16:56

2 Answers 2

68

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
  • 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
    Commented Nov 24, 2013 at 21:26
17

From the manual:

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

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .