| 1 |
.\" Copyright 1994-1995, Daniel Quinlan <[email protected]> |
| 2 |
.\" Copyright 2002-2017, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-3.0-or-later |
| 6 |
.\" |
| 7 |
.TH proc_pid_cmdline 5 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
/proc/pid/cmdline \- command line |
| 10 |
.SH DESCRIPTION |
| 11 |
.TP |
| 12 |
.IR /proc/ pid /cmdline |
| 13 |
This read-only file holds the complete command line for the process, |
| 14 |
unless the process is a zombie. |
| 15 |
.\" In Linux 2.3.26, this also used to be true if the process was swapped out. |
| 16 |
In the latter case, there is nothing in this file: |
| 17 |
that is, a read on this file will return 0 characters. |
| 18 |
.IP |
| 19 |
For processes which are still running, |
| 20 |
the command-line arguments appear in this file |
| 21 |
in the same layout as they do in process memory: |
| 22 |
If the process is well-behaved, |
| 23 |
it is a set of strings separated by null bytes (\[aq]\[rs]0\[aq]), |
| 24 |
with a further null byte after the last string. |
| 25 |
.IP |
| 26 |
This is the common case, |
| 27 |
but processes have the freedom to |
| 28 |
override the memory region and |
| 29 |
break assumptions about the contents or format of the |
| 30 |
.IR /proc/ pid /cmdline |
| 31 |
file. |
| 32 |
.IP |
| 33 |
If, after an |
| 34 |
.BR execve (2), |
| 35 |
the process modifies its |
| 36 |
.I argv |
| 37 |
strings, those changes will show up here. |
| 38 |
This is not the same thing as modifying the |
| 39 |
.I argv |
| 40 |
array. |
| 41 |
.IP |
| 42 |
Furthermore, a process may change the memory location that this file refers via |
| 43 |
.BR prctl (2) |
| 44 |
operations such as |
| 45 |
.BR PR_SET_MM_ARG_START . |
| 46 |
.IP |
| 47 |
Think of this file as the command line that the process wants you to see. |
| 48 |
.SH SEE ALSO |
| 49 |
.BR proc (5) |