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
1answer
33 views

How does Linux decide the /proc/PID/stat “name” of a process?

Currently my machine has 5 processes running scripts through python, but Linux thinks only 2 of them have the name python (according to /proc/$pid/stat). That is, pgrep -af python shows: 1784 ...
1
vote
1answer
30 views

Duration of /proc/pid/stat

I have a process that starts a child process and when the child exits, scans /proc/<pid>/stat to gather some information about the CPU and memory the child used. However I am worried that I am ...
0
votes
0answers
43 views

How to get the path of a current running script file?

Knowing that program's PID, I want to list out the executable file of a running program. For binary programs, I can read /proc/$pid/exe, which is a symlink to the executable. However for scripting ...
1
vote
1answer
44 views

Get the process start time irrespective of NTP updates

I'm trying to record the start time of a process kicked off by an @reboot cronjob. I'm using ps -p $$ -o ltime= presently, but I've run into a catch. My machine (a Raspberry Pi) connects to the ...
2
votes
0answers
33 views

OOM Killer: Processes have a score of over a 1000

All top links when Googling for OOM score seem to indicate that the values must be between -1000 and 1000. I tried to verify that with a simple cat /proc/*/oom_score | sort -n | less and I ...
1
vote
3answers
46 views

Get Linux architecture from /proc filesystem

I'm writing a program in Java and I need to determine the architecture for which Linux was compiled. I need something like uname -m, but without running any program, but instead from the /proc ...
-1
votes
1answer
17 views

du access failures

I ran du on a particular machine and two instances of failure: Since I ran as superuser I do understand how I can get denied. Second problem was with the proc tree: I kind of get the gist of why ...
1
vote
1answer
34 views

How can I check read permission of /proc/*/* files?

Files in /proc/ seem to be world-readable, but return permission denied: $ ls -lh /proc/5589/smaps -r--r--r-- 1 root root 0 Mar 18 13:11 /proc/5589/smaps $ cat /proc/5589/smaps cat: ...
2
votes
2answers
42 views

Can I add to /proc/self?

I want to create a number of named memory regions in my program, and mmap them somewhere so that other processes can read them. I can't guarantee that only one instance of my program will run at a ...
1
vote
1answer
44 views

Why doesn't INotify work with `/etc/mtab` or `/proc/mounts`? [duplicate]

When I used INotify with /etc/mtab or /proc/mounts, it doesn't detect changes when things mount or unmount, even though /etc/mtab and /proc/mounts both have changed when I check manually. Why is this, ...
2
votes
2answers
34 views

Can I set my core file location without being root?

It seems strange that I need to be root in order to say "place cores in my current directory" (via cat whatever /proc/sys/kernel/core_pattern). Isn't there any user-specific override for this?
0
votes
2answers
47 views

Awk run time error: not enough arguments passed

Here is the script: TYPE="${BLOCK_INSTANCE:-mem}" awk -v type=$TYPE ' /^MemTotal:/ { mem_total=$2 } /^MemFree:/ { mem_free=$2 } /^Buffers:/ { mem_free+=$2 } /^Cached:/ { mem_free+=$2 ...
0
votes
3answers
54 views

Why would the size of /proc/stat show as zero? [duplicate]

ls -rlth /proc/stat -r--r--r-- 1 root root 0 Feb 21 04:25 /proc/stat Although if we cat it, its got enough contents. Any help regarding this virtual FS will be helpful.
3
votes
1answer
39 views

Meaning and usage of /proc/[pid]/make-if-fail

I am currently developing inside an embedded Linux environment (kernel 3.10.0), and while goofing around in the procfs mount of the system I found that all processes present the following file in ...
2
votes
1answer
54 views

Linux Unix /proc Rename

How can I rename /proc to something else forcefully? mv /proc /0 gives mv: cannot move ‘/proc’ to ‘/0’: Device or resource busy
2
votes
2answers
61 views

How to find out the reason why ssh processes are hanging?

When I run command like iostat -dkx 2 2 via ssh, I get the expected result, but the processes on the local computer are saying alive in status "interruptible sleep". Why is this happening? Is there a ...
0
votes
1answer
51 views

Convert meminfo kB to bytes [duplicate]

To convert the readings in /proc/meminfo from "kB" to bytes, should I multiply by 1024, or 1000?
1
vote
1answer
45 views

Encoding of /proc/<pid>/cmdline files

I am thinking about working with the /proc/<pid>/cmdline files, but I couldn't find any documentation about the file encoding. The only piece of information I could find is located in the man ...
2
votes
2answers
148 views

Is there any way to hide kernel threads from ps command results?

When I type ps -ef , there are lots of special kernel thread processes showing. I am not interested in kernel threads; I am only interested in user process/thread. Is there a way that I can hide the ...
1
vote
2answers
53 views

Recover from faking /proc/meminfo

So, without really thinking too much, I ran this script: #!/bin/bash SWAP="${1:-512}" NEW="$[SWAP*1024]"; TEMP="${NEW//?/ }"; OLD="${TEMP:1}0" sed "/^Swap\(Total\|Free\):/s,$OLD,$NEW," /proc/meminfo ...
0
votes
0answers
15 views

This name appears in multiple /proc/interrupts

The name of the interrupt appears as follows: Multiple.. (85:exynos4210-uart) root@test:~# cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 28: 3543629726 1086578047 3268216812 ...
1
vote
2answers
535 views

How can I wake a process from sleep status via signal or /proc?

Many years ago I had an issue with Linux where processes would randomly go to sleep. Back then, I knew a trick with the /proc filesystem to trigger a wakeup of the process. I vaguely remember being ...
0
votes
0answers
20 views

fsync () get the impact of road /proc/sys/vm/drop_caches?

I have been testing the service life of TLC(1000write) SD card (4GB). SD card has been formatted with a fat partition. I am a write (), fsync () on a file of 10M SD card repeatedly. 1st (10M): ...
1
vote
1answer
185 views

cannot read key “net.ipv6.conf.all.stable_secret” in sysctl?

I am running kernel version as followings on an Arch Linux computer: [root@router ~ ]$ uname -a Linux router 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 and I noticed that every time ...
5
votes
3answers
244 views

How is the data in /proc/* gathered, and how reliable is it? [duplicate]

Recently I've been working with a cluster monitoring tool (ganglia) which aggregates system metrics from /proc/* on each machine. How is the data in /proc/* gathered? Who writes the data there? How ...
1
vote
1answer
236 views

What is the BOOT_IMAGE parameter in /proc/cmdline

I'm currently reading the book How Linux Works and in chapter 5 it talks about Linux parameters. Curious I started to see what were the parameters passed to my installed kernel when it boots up and ...
0
votes
2answers
168 views

(standard_in) illegal character when looping through a for loop

I'm trying to get statistics related to processes and general system information. If I do it without looping it runs fine, but if I put it within a loop it just gives me a chained error of illegal ...
3
votes
1answer
71 views

Does SSH access trigger keyboard interrupts?

So, I've been studying the basics for my LPIC-1, and I have a question about /proc/interrupts When consoled into a server, I can see key logging occurring (cat /proc/interrupts | grep i8042 count for ...
0
votes
0answers
17 views

Why number of dirty pages is always 0 on 2.6?

In /usr/src/linux/Documentation/filesystems/proc.txt i've found the string: Table 1-3: Contents of the statm files (as of 2.6.8-rc3) ...
1
vote
1answer
70 views

Why is the size of “/proc/kcore” file so bigger than the physical memory size?

From proc manual: /proc/kcore This file represents the physical memory of the system and is stored in the ELF core file format. With this pseudo-file, and an unstripped kernel ...
4
votes
1answer
49 views

Best way to programatically detect the current host (by hardware features)

I have a hard drive with a Linux installation on it that I like to boot from different physical computers. My question is whether it's possible to programmatically detect which computer the drive is ...
1
vote
0answers
58 views

There is no /proc/bus/usb directory

I'm running a centos VM on ESXi. Does the /proc/bus/usb directory not show up until a USB device is connected? I just added a USB controller to the VM (it previously had non) and ran lsusb: $ ...
1
vote
1answer
56 views

What is /proc/dma? Is it just for legacy support?

I reading a Linux book that told me I can check the dma channels by reading /proc/dma. This is what I see when I run cat /proc/dma: 2: floppy 4: cascade I'm confused because that looks like old ...
1
vote
0answers
37 views

proc system interrupts information

There are many info under /proc For examples, for each process : raw format : cat /proc/< pid >/stat human readable : cat /proc/< pid >/status My goal is to read the info ...
1
vote
0answers
42 views

code generating /proc file system

In my assignment, I have added "casper" flag to task descriptor and it takes only 0, 1, 2 and 3 (default 0). I asked to "modify the code that generates the /proc filesystem so that its behavior is ...
5
votes
2answers
144 views

Under what circumstances, if any, will the result of reading /proc/cpuinfo change?

What I understand so far is that when a program opens and reads any file under /proc/, the kernel will generate the information on the fly. In the specific case of cpuinfo most of that data is ...
2
votes
1answer
40 views

What happened to /proc/sys/fs/relatime_interval?

According to one answer relatime interval can be changed by echo 60 > /proc/sys/fs/relatime_interval but I do not have such a file? Where did it go? $ ls /proc/sys/fs aio-max-nr ...
0
votes
1answer
129 views

iotop and ionice -p show a different class/priority for the same process

After running ionice -c2 -n7 <PID> on an I/O-intensive process (VirtualBox VM) and checking the result with ionice -p <PID> it shows best-effort: prio 7 which is expected. But when ...
1
vote
1answer
259 views

How to get UID and PID

So here's what I want to do: User inputs a USERNAME. Based on this username, I need to get the list of processes started by this user. I am planning to do this by getting the UID of this user and ...
0
votes
1answer
45 views

How do I check how much total memory my VM has? [closed]

I've tried /proc/meminfo but my permission has been denied.
2
votes
1answer
93 views

How do I find out more about socket files in /proc/fd?

Looking in /proc/$mypid/fd/, I see these files lrwx------ 1 cm_user cm_user 64 Oct 14 03:21 0 -> /dev/pts/36 (deleted) lrwx------ 1 cm_user cm_user 64 Oct 14 03:21 3 -> socket:[1424055856] ...
4
votes
1answer
96 views

Why does a process of a binary with only execute permission remain hidden in “ps” when using hidepid=2, if the user is not root?

I'm using hidepid=2 to mount /proc, so users can't see any but their own processes. A particular binary I want to use has been restricted to rwx--x--x permissions, so only its owner (root) can read it ...
1
vote
1answer
154 views

Unable to read /proc/pid/stack file even with proper permissions

As far as i know, i should be able to read a regular file contents if i have the permissions to do so. Following is the output of ls -l stack for the stack file (/proc/pid/stack) for one of the ...
2
votes
0answers
226 views

Portable way to parse /proc/meminfo

I'm having trouble finding a generic code that work, here, for both CentOS 5/6 and CentOS 7 versions pc the /proc/meminfo file. I Want to compute the "Real Used memory" like free does. (amounts ...
1
vote
1answer
424 views

Read “/proc” to know if a process has opened a port

I need to know if a process with a given PID as opened a port without using external commands. I must then use the /proc filesystem. I can read the /proc/$PID/net/tcp file for example and get ...
1
vote
0answers
48 views

What does the “ss -s” result “Total:” value represent? How to get details on each of them?

I am trying to understand what the ss -s result line Total: value represents, along with how this number is related to the other numbers. Note, the following values are equivalent: ss -s Total: == ...
2
votes
0answers
271 views

Disk I/O latency using /proc/vmstat file

How do I calculate disk read and write latency in Linux? Is it possible to do the calculation using /proc file system? I am using iostat and vmstat command. But I do not understand how the ...
5
votes
1answer
401 views

What is /proc/<pid>/net/dev?

I'm interested in per-process network I/O counters, like those in /proc/net/dev and found what I thought was it under /proc/<pid>, i.e. /proc/<pid>/net/dev. But it seems that was too easy ...
0
votes
1answer
267 views

Linux Performance Measurements using /proc/vmstat

Am new to Linux, Please any one help. I want to calculate Input output performance using /proc/vmstat file? when i run command cat /proc/vmstat | grep pgpg The answer is pgpgin 726854 pgpgout ...
1
vote
1answer
195 views

Memory usage of a given process (using Linux proc filesystem)

I want to know which files from /proc directory and which fields of these files I need to calculate the memory usage of a given pid. I've been using the "stat" file and the "vsize" parameter that is ...