Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [proc]

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

0
votes
1answer
31 views

Why is the sum of /proc/pid/stat CPU greater than /proc/stat

In /proc/<pid>/stat I add user cpu, system cpu, child user and child system cpu together for all processes. I take a delta from a previous sample. Immediately after I sum the user, nice and ...
0
votes
1answer
23 views

How to get informations on each type of filesystem in /proc/filesystems

How do we get detailed information (history, what is used for, etc.) on each filesystem or pseudo filesystem displayed by : cat /proc/filesystems Example : nodev, sysfs, rootfs, ramfs, bdev, proc , ...
0
votes
1answer
50 views

Which files in `/proc` provides the following information?

From https://unix.stackexchange.com/a/492346/674 Kernels such as Linux and the kernels of the BSDs provide four (relevant) pieces of information about a process, via files in /proc and sysctl():...
1
vote
2answers
60 views

Where is the network data is stored on linux system?

is there a way I can find information about my wifi connections? Which networks I was connected to and when? I had tried to look for this information under proc/net but found nothing. (To be more ...
0
votes
2answers
62 views

Why /proc/meminfo shows MemAvailable under Kernel Version 3.10?

I've been using CentOS 7 and its kernel version is 3.10. To check Kernel Version, I typed 'uname -r' and command showed 3.10.0-957.1.3.el7.x86_64 As far as I know, MemAvailable metric was introduced ...
0
votes
0answers
36 views

Send string to another process stdin [duplicate]

Example process waiting an input sent to background $ read -p "Input text and hit ENTER to exit" & I try to write to stdin (fd/0) with \n $ echo -e "ok\n" > /proc/$!/fd/0 but $ fg read -p ...
2
votes
0answers
23 views

How to read information about wifi connection from proc - net? [duplicate]

Is there a way I can get information about my current WiFi connection on my android? Information like the name of the WiFi network, connection start time, connection duration etc.? I looked inside ...
0
votes
2answers
56 views

Is reading /proc repeatedly expensive?

Since the contents of /proc live inside memory, how expensive is reading it's content repeatedly (every second for example)? And does a program like top, htop or atop do that (reading /proc in every ...
2
votes
1answer
20 views

Why the output of ls is different for the same directory /dev/fd/ based on the method of referencing this directory?

cd /dev/fd/; ls Gives me output that I expect: 0 1 2 255 But: ls /dev/fd/ Gives different output that I don't expect: 0 1 2 3 Why? What happens here? What happened to file descriptor 255? ...
0
votes
1answer
17 views

How to measure the usage of disk cache?

Load Average itself is not very informative about the reasons of overload, so I want an additional characteristic: the percent of disk read operations that are done from cache. To measure it, I ...
1
vote
1answer
35 views

how does a non existing sid/pgid process possible?

I've listed processes on Ubuntu 17.04, Noticed the following process: root@user-virtual-machine:~# ps xao pid=,ppid=,pgid=,sid= 1603 1 1601 1601 however process 1601 does not exist. root@...
0
votes
1answer
84 views

Does constant writing to “files” in `/proc` or `/sys` reduce the life of my SSD due to its limited number of writing cycles?

My laptop has a SSD drive and I run a script which writes every other second to /sys/class/thermal/cooling_device4/cur_state. I don't think this would count as writing to the SSD and thus reducing its ...
0
votes
2answers
65 views

How to namespace the ps command?

I am trying to understand how linux containers work internally. One of the things that I have learned is that you can containerize a shell by passing in special flags to it. Out of the flags one is ...
0
votes
1answer
62 views

How to take number of bytes transmitted and received from /net/proc/dev

I want to take the number of bytes transmitted and received from /proc/net/dev in this format: num_ofbytesTransmitted,num_ofbytesReceived. This was my approach: cat /net/proc/dev | grep enp0s3 | cut -...
-1
votes
0answers
18 views

How to normalize runnables count per cpu?

Number of runnable processes can be determined using vmstat command's "r" column. My understanding is that to normalize this amount we should divide it by number of CPU's however I'm not sure if we ...
1
vote
1answer
39 views

Can you edit address values in “/proc/$pid/mem” to reflect changes in that process?

I would like to see if I can edit a value in my program while it is running by directly changing the memory. My thought process (untested) is to do the following: Run the program. Open up "System ...
1
vote
0answers
35 views

Why would strace and /proc/pid/stat show a process taking no CPU time, despite the process doing work?

Have a long-lived process (couple months) that is handling a huge number of connections and doing work, yet most statistics on it show it doing zero work. Here's an strace output, showing a bunch of ...
0
votes
2answers
38 views

In /proc/meminfo, does Dirty include or exclude Writeback?

Dirty %lu - Memory which is waiting to get written back to the disk. Writeback %lu - Memory which is actively being written back to the disk. -- man proc Does Dirty include Writeback? Or ...
1
vote
0answers
38 views

Allow a regular use to write in /proc/sys/net/ipv6/conf

I am using a fairly cheap VPN service in my Xubuntu 18.04 (VPN created using OpenVPN) and, as many other VPN services, is leaking my IPv6. I thought that maybe, since OpenVPN can run a script when it ...
1
vote
1answer
70 views

With Linux user namespaces, why can clone() mount /proc, but unshare() cannot?

I am trying to get a non-root user to mount /proc in a Linux user namespace. If I create a namespace via clone(), then I can mount /proc. However, if I create a namespace via unshare(), then the ...
2
votes
1answer
35 views

Uptime command misconception with suspend and resume states

The definition for uptime is "Tell how long the system has been running." but if you change your system power state to suspend or resume: # uptime 09:50:33 up 8 min, 2 users, load average: 0,24, 0,...
3
votes
1answer
82 views

Get latest output of a running command

I have a command running for a long time, which I don't want to disturb. However, I would like to keep check on the process (most of the time remotely). I am constantly monitoring the process via ...
2
votes
2answers
172 views

How to remount special device proc which does not exist?

I did this: root# mkdir /tmp/test && mount --bind /tmp/test/ /proc/ root# rm -rf /tmp/test root# mount -t proc proc /proc But then I ran into this: mount: special device proc does not ...
1
vote
1answer
44 views

Can I assume /proc will always be readable?

I'm developing a script that will monitor several machines, notably by reading from /proc/[vmstat|stat|diskstats|net/dev] and I'm wondering if I can assume those will always be accessible and readable ...
0
votes
1answer
32 views

Set Linux system time to time from /proc/version

What sequence of awk, sed, and/or cut commands can I use to take the date at the end of /proc/version, for example Linux version 4.15.7 (user@system) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+...
2
votes
1answer
234 views

What is proc/ directory in Ubuntu Server [closed]

I am navigating one of my Ubuntu servers and was wondering what the numbers 1-26758 are under the proc/ folder. Are these ports or something else?
0
votes
0answers
107 views

Measure memory usage of forked processes

In order to measure memory usage of a process, Iam using the VmPeak and VmSize fields of /proc/[pid]/status. What happens to memory reporting if this process is forked after allocating memory? My ...
-1
votes
0answers
30 views

/proc folder - command to include/not include switches in status output & view processes using certain services or i/o devices

I have a homework problem (congregational "ugh" and downvote) that states the following: Thoroughly compare the stored process information for at least four (4) different processes. Find the ...
7
votes
2answers
146 views

“find” exclude by fstype strange behavior

I try to have "find" command exclude "/proc" filesystem. I would prefer a portable solution to be able to use it on non GNU based hosts (oldest AIX for instance, where "find" do not have the "-path" ...
0
votes
0answers
143 views

/proc/pid/stat cpu ticks are not updated

I'll be as precise as possible: On my RHEL7 machine (3.10.0-514.el7.x86_64), /proc/PID/stat is not updated in respect to CPU ticks, sometimes for a minute and more. I'm clearly at a loss how this can ...
0
votes
1answer
201 views

display the file descriptors of a process using python [closed]

How can I display the open file descriptors of a process in linux using python script? I tried using readlink /proc/PID/fd/* in python script but I am getting error. /bin/sh: 2: /fd/*: not found ...
0
votes
1answer
147 views

What is the meaning of the connection state constants in /proc/net/tcp?

I'm creating a parser for /proc/net/tcp, and I would like to know what are all the possible constants for the connection states (fourth column)? I know 0A means LISTENING, but Google results don't ...
1
vote
0answers
51 views

Why is the output of top command not the same as /proc?

Sometimes I see the output of top output like this But when I try to access /proc, it gives me different information, like this Why do I see different session ID from top and /proc?
0
votes
1answer
112 views

Diff outputs “binary files <file1> <file2> differ” but not the usual detail output

I would like to compare two files - "orienv" and "currenv", using the command diff. The way I had created the two files was as follow: Createing the "currenv" file $cat /proc/1/environ >> ...
1
vote
0answers
24 views

Can I somehow identify the physical machine from inside an OpenVZ container?

I am using some VPSes in OpenVZ containers. As I can see, our hosting provider somes moves them between his physical machines. It also means unwaited (and unexpected) reboots. I have no technical ...
1
vote
1answer
38 views

Why I can't see port opened by a process in file descriptors?

I have a rabbitmq management process running, which opens a port 15672, tcp 0 0 0.0.0.0:15672 0.0.0.0:* LISTEN 5431/beam As you can see the process has a PID ...
7
votes
1answer
97 views

Strange behavior of `/proc/self/environ` in some shells; what is going on?

I'm on Debian GNU/Linux 9. I know /proc is special, I know what /proc/self is. This command sh -c '/bin/cat /proc/self/comm - </proc/self/comm' yields cat sh The pattern will be similar if I ...
0
votes
2answers
58 views

Why does shebang lead to a different process name than an explicit call?

Summary Using mirage as an example, a python program that begins with a shebang: #!/usr/bin/python ... Looking at /proc/<pid>/comm or using pgrep, it appears like ... ... the process name ...
0
votes
1answer
194 views

/proc/PID/sched measure units

Does anyone know what are the measurement units for the metrics in /proc/<PID>/sched file in Linux? cat /proc/1277/sched flush-202:32 (1277, #threads: 1) ----------------------------------------...
2
votes
2answers
741 views

What are anon_inodes?

While looking through /proc/[PID]/fd/ folder of various processes, I found curious entry for dbus lrwx------ 1 root root 64 Aug 20 05:46 4 -> anon_inode:[eventpoll] Hence the question, what are ...
0
votes
1answer
76 views

Is /proc folder and process details really exists on hard drive [duplicate]

I am a little bit confused about /proc directory. Each process frequently updating its state, memory info, progress etc in their process. My question is that the /proc directory keeps the memory or ...
0
votes
1answer
268 views

Where to find iowait stat for a single process (as a file)

I am writing a script and I need to find a file in which statistics for a single process/pid/service's iowait are stored. Is there any such file at all on Debian-based distributions? Nor /proc/<...
0
votes
0answers
196 views

Why is cat /proc/[pid]/pagemap not giving any output?

When I use the command cat /proc/<pid>/pagemap, I'm not getting any output. Usually I used to get some binary output but now I am not getting anything. The output starts coming after an hour ...
1
vote
1answer
48 views

How to remove sshd pts processes in status D without restarting servers

Why are these sshd-pts processes stuck in status D? It seems the system load averages are increasing due to these processes. How can I remove them without restarting my server. (add ppid and etime) [...
0
votes
0answers
182 views

Measuring block I/O delays using proc FS

I'm trying to measure IO delay due disk access. For this I'm using delayacct_blkio_ticks from /proc/[pid]/stat response. What I'm getting is a constant 0, no matter how much IO is done in my app. The ...
17
votes
2answers
3k views

What does the “bugs” section of /proc/cpuinfo actually show?

On a Debian Stretch and testing/Buster system with a current kernel and installed microcode I still see meltdown and spectre listed as bugs in /proc/cpuinfo. However, running the spectre-meltdown-...
1
vote
1answer
24 views

How to know which script/binary/other running process?

From ps -ef | grep java, I see many process like this that take a lot of memory. hadoop-+ 65369 65322 0 Jul06 ? 00:01:45 /usr/jdk64/jdk1.8.0_112/bin/java -Xmx8024m -Dhdp.version=2.6.4-091 -...
3
votes
0answers
431 views

Explain output of cat /proc/vmallocinfo

What does this output represent after doing cat /proc/vmallocinfo. I know, this gives mapping of virtual address space of kernel. But want to have in-depth understanding. Questions What are actual ...
3
votes
0answers
174 views

How can `cat /proc/$pid/cmdline` take several seconds?

I encountered this strange behavior yesterday on one of our servers. ps, pgrep and htop (on startup) were very slow. strace ps showed that read('/proc/$pid/cmdline) took several seconds on some ...
0
votes
1answer
374 views

Get IP address of socket used by process

given a process Id (that use sockets), I would like to get the IP on socket endpoints. e.g When new SSH session is created, the sshd demon fork process per session. I want to get the IP endpoints ...