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 ...
5
votes
1answer
532 views

What is the meaning of the contents of /proc/net/unix?

On my Android device there is the file called /proc/net/unix who's content does not conform to that of any standard linux distribution (which show the unix domain sockets.) First few lines: Num ...
4
votes
1answer
3k 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 ...
8
votes
2answers
2k views

Is it possible to create a directory and file inside /proc/sys?

I am running CentOS 6.2 and I need to create a subdirectory named "crypto" inside /proc/sys. Inside /proc/sys/crypto, I need to create a file named test which contains the value "1". I have tried ...
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 ...
1
vote
1answer
42 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 ...
0
votes
0answers
42 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 ...
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: ...
0
votes
1answer
2k 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 ...
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, ...
4
votes
1answer
272 views

/proc/net/wireless does not show values unless run as root

cat /proc/net/wireless does not show statistics for wireless devices unless it is run as root, even though the permissions on the file are 444. The same seems to apply when accessing statistics via ...
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
53 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?
4
votes
1answer
153 views

Does /proc/[pid]/status always use kB?

Particularly, does proc always list the VmRSS value in kB? I can't find a solid answer on the documentation, although it appears that it sticks to one unit.
1
vote
0answers
152 views

Viewing shared segments created by shmget

I'm trying to "visualize" shared memory between two processes. I've created a little server-client example where the client writes some data to a shared memory location and the server reads from it. ...
1
vote
1answer
44 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 ...
1
vote
1answer
69 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 ...
2
votes
2answers
147 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 ...
1
vote
1answer
184 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 ...
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 ...
2
votes
1answer
4k 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 ...
24
votes
7answers
99k views

Tell fs to free space from deleted files NOW

Is there a way to tell the kernel to give back the free disk space now? Like a write to something in /proc/ ? Using Ubuntu 11.10 with ext4. This is probably an old and very repeated theme. After ...
1
vote
2answers
528 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): ...
92
votes
4answers
61k views

How do I read from /proc/$pid/mem under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me $ cat /proc/$$/mem ...
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 ...
5
votes
1answer
1k views

/proc/cpuinfo showing zero cpu clock speed

I saw an interesting issue where the cpuinfo file from /proc filesystem shows the cpu clock speed as zero. It is a physical host with no virtualization. Can someone explain to me some probable reasons ...
1
vote
1answer
231 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 ...
7
votes
2answers
9k 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 ...
0
votes
2answers
165 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) ...
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
55 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 ...
73
votes
3answers
17k 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?
2
votes
1answer
39 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 ...
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 ...