CONTRIBUTING.d/patches: Please provide a git-range-diff(1)
[man-pages.git] / man5 / proc_pid_cmdline.5
blob047cacd62677729d4c95bb47c7fb6fdacb8e0d4c
1 .\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2 .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4 .\"
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
6 .\"
7 .TH proc_pid_cmdline 5 (date) "Linux man-pages (unreleased)"
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]\e0\[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)