procfs (or the proc filesystem) is a special filesystem in UNIX-like operating systems that presents information about processes and other system information in a hierarchical file-like structure

learn more… | top users | synonyms

4
votes
3answers
373 views

Why can't I `tail -f /proc/$pid/fd/1`?

I wrote a simple script which echo-es its PID: #/bin/bash while true; do echo $$; sleep 0.5; done I'm running said script (it says 3844 over and over) in one terminal and trying to tail ...
2
votes
0answers
24 views

Why does each process folder under /proc contain the same information?

Under /proc/<PID>/net pseudo-file system each process seems to have files with the same content. For example I use cat /proc/<PID>/net/ip_tables_names to list iptables tables under the ...
2
votes
1answer
30 views

Pernicious USB-stick stall problem. Reverting workaround fix?

There's an issue with Ubuntu that hasn't been fixed yet, where the PC freezes or gets really slow whenever it is copying to an USB stick (see Why is my PC freezing while I'm copying a file to a ...
0
votes
2answers
33 views

Skipping pseudo-directories with find /

There are some directories that can cause problem with find, and especially "find /". These are directories in which the OS creates files which are not really files. Among these directories are /proc ...
1
vote
1answer
31 views

/proc/config.gz is of 0 bytes

I have an Android TV stck I compiled Linux for IT from https://github.com/Galland/rk3x_kernel_3.0.36 But when I booted that Image I found /proc/config.gz is of 0 bytes can some please explain how ...
6
votes
1answer
36 views

How do I know what decompression algorithms are compiled-in into the linux kernel?

If /proc/config.gz is unavailable, how do I know what decompression algorithms the running kernel is capable of using on a compressed cpio initramfs? Is the gzip algorithm always available, even when ...
3
votes
1answer
37 views

How do I find out what filesystem drivers are compiled-in into the linux kernel?

On a running linux system, what is a portable (among linux distributions) way to find out what filesystems the current kernel has compiled-in (not through modules) support for? Consider for example ...
0
votes
2answers
35 views

Using /proc/stat for the number of processes running on the system

How does one find out the true number of processes that is running on your system. A number of articles mention using ps in order to count the number of processes. But recently I looked at cat ...
3
votes
1answer
90 views

How to programmatically retrieve the GID of a running process

I need to write some C code to check the effective GID of a running process whose PID I know. I've not found any direct way to do this. There are a number of heavyweight kludges I could use, such as ...
0
votes
1answer
50 views

Is Inactive memory related to the Commited but unused?

From the Linux procfs documentation: Active: Memory that has been used more recently and usually not reclaimed unless absolutely necessary. Inactive: Memory which has been ...
4
votes
1answer
64 views

What causes /proc/<pid>/* resources to become owned by root, despite the procs being launched as a normal user?

I've noticed that some procs, such as bash, have their entire /proc/<pid>/ resources readable by the user who created that proc. However other procs, such as chrome or gnome-keyring-daemon, have ...
1
vote
1answer
244 views

Is it possible to get process group ID from /proc?

In "http://stackoverflow.com/questions/13038143/how-to-get-pids-in-one-process-group-in-linux-os" I see all answers mentioning ps and none mentioning /proc. "ps" seems to be not very portable ...
1
vote
2answers
94 views

In Linux, why do you need to be root to write to /proc/sysrq-trigger?

WARNING: THE NEXT KEY COMBINATION WILL CRASH YOUR COMPUTER Ok, I get that this is an administrative tool and all, but I realized that any user can do ALT + SysRq + C. This link explains what I'm ...
3
votes
1answer
54 views

OOM Killer value always one less than set

I am trying to set the oom_adj value for the out of memory killer, and each time I do (regardless of the process) I get back exactly one less than I set (at least for positive integers. I haven't ...
2
votes
2answers
198 views

/proc/pid/maps addresses (and converting them)

When looking at the memory maps in /proc/pid/maps, we can see different length addresses 00400000-0042e000 r-xp 00000000 fb:01 268953 /bin/nano 0062e000-0062f000 r--p ...
17
votes
7answers
647 views

How do I source another process's environment variables?

If I examine /proc/1/environ I can see a null-byte-delimited string of process 1's environment variables. I'd like to bring these variables into my current environment. Is there an easy way to do ...
4
votes
1answer
86 views

Does pipe's link target exist somewhere in the filesystem?

I'm talking about this: $ readlink <(echo test) pipe:[80076194] Is pipe:[80076194] a path to the target or just indication that the file descriptor is connected to the pipe and doesn't exist in ...
1
vote
1answer
258 views

how to determine the max user process value?

Which value is correct?(or they are all correct, but which one will take effect?) $ cat /proc/sys/kernel/pid_max 32768 $ ulimit -a |grep processes max user processes (-u) 77301 $ cat ...
5
votes
2answers
326 views

Portability of file descriptor links

I've always wondered this but never took the time to find out, so I'll do so now - how portable is the usage shown here of either /proc/$$/fd/$N or /dev/fd/$N? I understand POSIX guarantees /dev/null, ...
55
votes
3answers
3k views

What happens when I run the command cat /proc/cpuinfo?

What happens when I write cat /proc/cpuinfo. Is that a named pipe (or something else) to the OS which reads the CPU info on the fly and generate that text each time I call it?
3
votes
1answer
93 views

What's the correct value to base the maximum number of CPU's to sched_setaffinity to?

I have some confusion as to what's the correct value to use for the number of CPU's I can use to make a CPU_SET for a sched_setaffinity call on my system. My /proc/cpuinfo file: processor : 0 ...
3
votes
1answer
213 views

Kernel /proc ipv6 settings precedence

I'm about to connect our network to the IPv6 Internet and need to control the kernel ipv6 settings found under /proc. I know there are configurations for each interface, for all interfaces, and the ...
3
votes
1answer
498 views

Does “syslogd” cause “cat /proc/kmsg” not to work properly?

I'm using cat /proc/kmsg to determine which process and file was involved in certain disc writes. I'm using the method given in this answer. But when I use cat /proc/kmsg, the output doesn't always ...
3
votes
1answer
490 views

Accounting for /proc/net/dev reported traffic

I noticed that according to /proc/net/dev I am constantly receiving around 6Kb/s on my wireless usb interface. But I can't account for anything even close to that with the individual connections that ...
2
votes
0answers
129 views

/proc/self/maps - 3rd mapped piece of file?

I'm running Arch linux on my laptop, which is kernel 3.12.9 right now. Something has changed about the way the kernel maps in a dynamically-linked executable and I can't figure it out. Here's the ...
1
vote
1answer
307 views

Do VmPeak & VmHWM have any measurement periods?

While reading kernel documentation I came across VmPeak & VmHWM, and it's a bit unclear to me. VmPeak in /proc/<pid>/status is described to be peak virtual memory size. Peak for what ...
0
votes
2answers
205 views

How to get total disk read/write in bytes per hdd device from /proc

How to get total disk read/write in bytes per hdd device? for example if i have sda, sdb, and sdc, is there any file on /proc that i could use similar to /proc/net/dev for networking?
2
votes
3answers
293 views

How to find out easily whether a block device (or a part of it) is mounted somehow

I want to know what the easiest way is to determine (without root privilege) whether a block device (say sdb) or any part of it is mounted (and which part of it). Checking /proc/mounts for sdb is not ...
3
votes
1answer
185 views

What is the Inverse of Idle in /proc/stat?

/proc/stat/ includes the following fields: "user", "nice", "system", "idle", "iowait", "irq", "softirq", "guest", "guest_nice", Which subset of those fields + idle accounts for 100% CPU? Is there ...
1
vote
2answers
105 views

processor(s) statistics that is one day old

I already know how to use grep -w cpu /proc/stat in order to get the cpu stats and identify the user mode. Percentage wise, I just divide it my the total time from the /proc/uptime. However, how can ...
1
vote
1answer
384 views

The amount of time since the system was last booted [duplicate]

I have used both uptime and cat /proc/uptime commands. I know the idle time in the later can be greater than running time (multiprocessors). However, when I add both running and idle times, and ...
3
votes
3answers
3k views

“echo 3 > /proc/sys/vm/drop_caches” - Permission denied as root

I am currently having some issues with the cache. It is a little too much right now so I wanted to clear it. I googled and found this little command: sync && echo 3 > ...
0
votes
1answer
484 views

root permission denied on /proc/1/exe

I just performed a fresh ubuntu install and i am seeing the following in lsof: userA@az1:~$ lsof COMMAND PID TID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 ...
8
votes
2answers
1k views

Determine if a specific process is 32- or 64-Bit

Given a 2.6.x or newer Linux kernel and existing userland that is capable of running both ELF32 and ELF64 binaries (i.e. well past How do I know that my CPU supports 64bit operating systems under ...
2
votes
2answers
614 views

Busybox ash script does not exit cleanly after executing cat; unable to get exit code

Consider the following script wrapcat.sh (a wrapper for cat) for illustrative purposes. It is run with busybox (ash) in an embedded Linux 2.6 box. #!/bin/sh cat $1 Under certain circumstances, this ...
2
votes
2answers
433 views

where does lspci gather its information from?

In kernel.org's documentation on proc I found "[The latest version of this document is available online". There I says: "… lspci is a synonym for cat /proc/pci". Which isn't the ...
4
votes
2answers
187 views

UUID in /etc/mtab

In some versions of Ubuntu. Disks are mounted by UUID. in My machine, /proc/mounts /dev/disk/by-uuid/UUID / ext4 rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0 /etc/fstab UUID=U-U-I-D ...
4
votes
1answer
109 views

Why is UID information not in /proc/X/stat?

This is a silly question for the sake of academics; I know where to get the UID information if I need it. According to the proc(5) man page: /proc/[number]/stat Status ...
6
votes
1answer
1k views

How do I know if a serial port is actually transmitting data, without opening the device?

I have a high-availability cluster (Heartbeat) connected via serial line and two ethernet NICs. I'd like to set up a monitoring script capable of recognizing disconnected serial line (basically the ...
1
vote
0answers
77 views

Value of /proc/sys/kernel/hostname

I've set computer hostname in /etc/hostname a while ago (also there are record in /etc/hosts). Everything worked fine, but recently I've noticed that value of hostname (and /proc/sys/kernel/hostname) ...
3
votes
1answer
120 views

Is there a way to show all flags in /proc/mounts?

Some filesystem flags seem to be hidden in /proc/mounts, depending on whether they are defined as defaults. Is there a way to show all flags in /proc/mounts, also including the default ones? And if ...
1
vote
1answer
1k views

Modify 'Soft Limit' of 'Max processes'

I tried ulimit -u 2000 and ulimit -Su 2000 to modify the 'Max processes', and started up my program, but failed. I found file '/proc/pid/limit' is still: Max processes 1024 ...
6
votes
2answers
230 views

Which of proc, sys etc. should be bind-mounted (or not) when chrooting into a “replacement” distribution?

This answer to another question basically boils down to chrooting into another Linux distribution in order to mainly use that as a replacement to its too restricted (but irreplaceable) parent. The ...
2
votes
2answers
88 views

Detecting kernel thread on pre-3.0 kernels

Looking at the proc man page (http://man7.org/linux/man-pages/man5/proc.5.html) it is possible to detect which processes are kernel threads in /proc/<pid>/stat by looking at the flags value ...
3
votes
3answers
316 views

Command line options of rackup are not shown in ps output or procfs

As you know if you wish to get command-line runtime arguments for running command you can parse ps -e or /proc/<pid>/cmdline. But I have encountered issue when this method returns only command ...
1
vote
1answer
218 views

Ubuntu: /proc/pid/comm file missing

On my development box, under /proc/[pid]/ there is a file called comm containing the name of the executable for that process. I use this to validate the process to which I am sending a signal. On our ...
4
votes
2answers
959 views

Notify of changes on a file under /proc

I have written a small 'daemon' in bash that will switch to the headphones if they are detected, and if not, switch to an external USB speaker with PulseAudio. What I'm looking for is some way to get ...
10
votes
1answer
1k views

sysctl: /proc/sys/net/ipv[46]/conf/: what's the difference between “all”, “default” and “eth*”?

In sysctl, the /proc/sys/net/ipv[46]/conf/ keys have the following subkeys: all, default, and a key for each network interface. For example, on a machine with a single network interface eth0, it will ...
3
votes
2answers
67 views

How proc gets updated about the devices [duplicate]

If i do cat /proc/asound/cards it lists all the sound card details from where proc gets this information.This file is continuously updating what if i want to make a manual entry
6
votes
2answers
828 views

/proc/sys vs /sys/modules/mod/parameter

I've been wondering for last few days how exactly does it work. We can set kernel runtimes parameters using sysctl or echo boolen 1> /proc/sys/module/exactParameter but in ...