$ bat /proc/3151/cmdline
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: /proc/3151/cmdline <BINARY>
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ /bin/cat /proc/3151/cmdline;
sleep100%
I was trying to read /proc/[pid]/cmdline using bat and expected it to behave like cat, but it doesn't.
Should any exceptions be made for the /proc filesystem?
See man 5 proc:
PROC(5) Linux Programmer's Manual PROC(5)
NAME
proc - process information pseudo-filesystem
DESCRIPTION
The proc filesystem is a pseudo-filesystem which provides an interface to kernel data structures. It is commonly mounted at /proc.
Typically, it is mounted automatically by the system, but it can also be mounted manually using a command such as:
mount -t proc proc /proc
Most of the files in the proc filesystem are read-only, but some files are writable, allowing kernel variables to be changed.
I was trying to read
/proc/[pid]/cmdlineusingbatand expected it to behave likecat, but it doesn't.Should any exceptions be made for the
/procfilesystem?See
man 5 proc: