Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
mark@mark-VirtualBox:~/auto/lib$ 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)

share|improve this question
1  
my arch-nemesis, user626201, has already asked this question on stackoverflow stackoverflow.com/questions/7078258/… –  joslinm Oct 5 '11 at 22:09
3  
Yes, those are usually kernel threads. –  Stéphane Gimenez Oct 5 '11 at 22:23
1  
When would they not be kernel threads? When are "process args unavailable"? –  mgalgs May 1 '13 at 17:00

2 Answers 2

up vote 21 down vote accepted

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.

share|improve this answer
    
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.) –  naxa Nov 24 '13 at 21:26

From the manual:

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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