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

1
vote
1answer
27 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
50 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
38 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
10 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
87 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
9 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
81 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
238 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
76 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
60 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
68 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
15 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) ...
2
votes
1answer
47 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
47 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
24 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
30 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
32 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
40 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
134 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
31 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
69 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
167 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
38 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
73 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
83 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
117 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
179 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
256 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
45 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
194 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 ...
4
votes
1answer
289 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
196 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
123 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 ...
-1
votes
4answers
297 views

How to get hard disk information from /proc and/or /sys

How can I get hard disk capacity, usage, etc. using the /proc or /sys filesystems? What file(s) do I need to process to get that information? Does any one know, how to find Hard disk size, usage, etc ...
3
votes
1answer
124 views

How to run free command by crontab

I want to run this command: free && sync && echo 3 > /proc/sys/vm/drop_caches && free -m by cron. That way I can free my RAM and cache in an Ubuntu system. I'm using ...
0
votes
1answer
1k views

Linux ps -elf command output, what is Process Flag meaning?

In output of ps -elf command in linux, we can recognize that process flag of 4 and 1, and process flag of 5, (sum of 1 and 4), but what is meaning of process flag 0 ? unfortunately, man does not help ...
1
vote
2answers
31 views

Directory in /proc that isn't process dir but start with number?

Quick question. Is it possible to create directory in /proc that starts with number but isn't process directory (where name is PID)? I write software that searches for process directories and I wonder ...
5
votes
1answer
197 views

Is /proc strictly reserved for kernel/driver space?

When developing a userspace application or daemon, it is good design practice to provide some form of component status. I have often thought of using /proc for this purpose - is this an acceptable ...
1
vote
2answers
97 views

Wrong eUID in `/proc/PID/status` when SETUID is used

While doing a wargame challenge, I ran into an issue with permissions. The info given by /proc/PID/status is not in adequation with the permissions that should be given to the processus. I am user ...
3
votes
1answer
119 views

What do the fields in /proc/net/ipt_hashlimit/FILE mean?

What do the fields in /proc/net/ipt_hashlimit/FILE mean? These files are created upon iptables -A CHAIN -m hashlimit--hashlimit-name FILE [...] [...] 9 198.51.100.23:0->0.0.0.0:0 80000 80000 160 ...
6
votes
3answers
132 views

Peek at the contents of stdin

I'm trying to debug a Linux application that can receive commands via stdin, and it would be really useful to be able to see everything that gets written to stdin. My first approach was to execute ...
0
votes
1answer
87 views

lsof vs cat/proc/…/maps [closed]

While looking for a detection method for services that would need to be rstarted after patching OpenSSL, I stumbled over a difference between the return of those 2 commands : [root@host ~]# cat ...
2
votes
0answers
29 views

Significance of Linux kernel's default_console_loglevel

What is the significance of default_console_loglevel in Linux? Commonly I see it described as the default value of console_loglevel. However, what that means I haven't seen explained anywhere. ...
0
votes
0answers
296 views

How to change the console_loglevel in linux?

I read at multiple places (e.g. here http://elinux.org/Debugging_by_printing), that you can change the console log level by echoing an integer to /proc/sys/kernel/printk. If that worked shouldn't the ...
1
vote
0answers
20 views

Inconsistent output on /proc. Can some processes be hidden? [duplicate]

When I list /proc/<PID>, works as expected. But when I use ps or ls /proc | grep <PID>, the process is hidden. How & Why is this possible? [user@host ~]$ ls /proc/12263 attr ...
1
vote
0answers
63 views

What is kswapd_low_wmark_hit_quickly from /proc/vmstat

What does this parameter mean? # cat /proc/vmstat | grep low kswapd_low_wmark_hit_quickly 2
0
votes
0answers
81 views

How to determine the memory usage of a single process?

There a few helpful scripts out there, which give some useful information. But I would like to calculate those values myself. I am interested in values like USS and PSS. I already had my first attempt ...
0
votes
0answers
133 views

Why cancelled_write_bytes is different size than created/removed file?

I was wondering how field cancelled_write_bytes from /proc/[pid]/io works, so I've created a file (dd) and then deleted it (rm). I was expecting to see cancelled_write_bytes ~equal to file size while ...
2
votes
1answer
205 views

Why is one file listed sereval times in /proc/pid/smaps?

When I cat /proc/1/smaps file I found that libs have often up to 4 mappings with different sizes and different Rss/Pss etc: 7f1a09696000-7f1a0982f000 r-xp 00000000 fe:04 1313975 ...
3
votes
2answers
290 views

Which Linux capability do I need in order to write to /proc/sys/vm/drop_caches?

I am trying to clear my filesystem cache from inside a docker container, like so: docker run --rm ubuntu:vivid sh -c "/bin/echo 3 > /proc/sys/vm/drop_caches" If I run this command I get sh: 1: ...