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

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

I want to display specific infomation from /proc/cpuinfo

I want to Show the number of CPUs, the producer of the CPUs and the CPU model. I have used cat /proc/cpuinfo to show the cpuinfo. however i want to only display the needed information. e.g. processor ...
0
votes
1answer
55 views

Why cwd in /proc/nautilus_pid/cwd always points to /home/username?

I wanted to check the current directory opened in nautilus window. I check the pid of nautilus, and symbolic link proc/pid/cwd, always points to home directory. Is this expected behaviour? If so ...
1
vote
1answer
22 views

Bind-mount and cryptsetup result in truncated root-path in /proc/self/mountinfo

I have an encrypted container containing an ext4 filesystem with a subdirectory which is bind-mounted at a later point in time. If I take look at /proc/self/mountinfo, the root-directory for the mount ...
3
votes
1answer
31 views

Where does one find the total number of context switches performed since bootup?

I figured out that the number of context switches performed by a process can be found in /proc/$$/status. I have been trying to look for the total number of context switches performed since bootup. I ...
3
votes
1answer
43 views

How to access /proc/ file (procfs) via SSHFS

Using a computer with Ubuntu 16.04 (no update suggestions please) I mounted /proc/ at my Raspberry Pi 3B + (linux kernel version 4.19.88) via SSHFS: sshfs pi@192.168.0.4:/proc ~/procAtPi ls -la ~/...
2
votes
1answer
140 views

Getting the executable name in Linux from /proc/ and detect if it's truncated

The executable name is linux can be read in various ways. By reading /proc/[pid]/comm, which contains a string that's truncated after reaching 16 characters or TASK_COMM_LEN. By reading /proc/[pid]/...
1
vote
1answer
57 views

Chinese Characters in One of a File

I have found some chinese characters in one of a file on my linux mint 20.1 File - /proc/1/cmdline Chinese Characters - 猯楢⽮湩瑩猀汰獡h But when i open same file in terminal using less command, it shows : /...
1
vote
0answers
16 views

Is there a way to tell how much memory is file-backed on Linux process?

I'm looking to see how much of my memory is file-backed on a process. Unfortunately proc/pid/smap_rollup shows stats for how much memory is being used, but it doesn't seem to differentiate between ...
2
votes
0answers
32 views

Get the full path of running script from /proc

If a running script was called directly, as in not by calling its interpreter with the script's path as an argument, how can the full path to script file reliably be retrieved regardless of the ...
0
votes
0answers
37 views

Manipulate the result of uname?

Is it possible to fool Linux what CPU, the amount of memory etc it runs on? I have a NAS running an obscure custom Linux distribution (Seagate's internal) that requires a certain hardware to enable a ...
1
vote
1answer
58 views

Calculate TCP memory usage (does not add up)

I am running a Debian GNU/Linux 9.5 (stretch) with kernel: 4.9.0-7-amd64. I have found the culprit of a memory consumption problem I am facing to be an in-app mechanism for sending logs to FluentD ...
0
votes
1answer
57 views

Difference between CPU usage in top and /proc/stat

I'm trying to write a little script that, among other things, calculates the cpu usage by reading /proc/stat, and I can't seem to get consistent results. I'm basically doing a grep cpu /proc/stat and ...
0
votes
1answer
24 views

Getting a parent script name from a child script

CentOS/RHEL 7. GNU bash, version 4.2.46(2)-release I have two bash scripts, lets call them parent.sh and child.sh. The parent just calls the child thus: # parent.sh ./child.sh and in child.sh I want ...
1
vote
2answers
29 views

How can I list network devices and ipv4 address on linux without ifconfig/ip command

This is NOT a duplicate of How to get my own IP address and save it to a variable in a shell script? ; it is an attempt to revicve How can I list net work devices and ipv4 address on linux without ...
-2
votes
1answer
38 views

Do user mode processes have to change to kernel mode to access /proc and /sys filesystems

Computer Systems: a Programmer's Perspective says Processors typically provide this capability with a mode bit in some control register that characterizes the privileges that the process currently ...
0
votes
0answers
17 views

How to identify GPU processes (or processes in general) that have been idle for the last x consecutive hours?

How would one go about identifying processes (gpu processes specifically) that haven't done anything in the last 2 hours - for example? The problem I'm having stems from multiple users trying to use a ...
0
votes
0answers
24 views

Allow Special Users Accessing /proc not Working

I have a CloudLinux7 server which is using hidepid to prevent users access /proc. However, I also need the monitoring tool has the permisison. So, I set up the gid while mounting the dir. But, it ...
0
votes
0answers
27 views

Is my From-Scratch system using fstab?

I've started writing a simple, small distro, not using LFS. Everything has been going amazingly smooth so far. I only have one problem, which I address here - whenever I boot up, my system is "...
1
vote
2answers
73 views

when /proc/cpuinfo begin to update all the time, especially the field “cpu MHz”? [duplicate]

I saw that /proc/cpuinfo update all the time, especially the field "cpu MHz"? I assumed that these details should be constant. When did /proc/cpuinfo begin to update all the time, especially ...
0
votes
1answer
107 views

UDP Packet drops

I understand that the receive flow for a UDP packet is Check udp header for errors Match destination to socket Send an error message back if no such socket Put packet into appropriate socket receive ...
3
votes
1answer
219 views

Does /proc/ contains tid?

I have process id 1234. This process contains thread id 1235. When I use ls -l /proc I see only the pid (1234) but when I open the thread status file using cat /proc/1235/status I can see data. Why is ...
-1
votes
1answer
46 views

How to find out on which core a thread is running on?

Let's say we have a CPU-intensive application called multi-threaded-application.out that is running on top of Ubuntu with a PID of 10000. It has 4 threads with tid 10001, 10002, 10003, and 10004. I ...
-1
votes
1answer
38 views

Does /dev, /run and /sys exist on HDD (if so what is there location if it can be meaningfully traced)?

At the time of Linux installation, i have mentioned only one filesystem (/dev/sda1 -> ext4 -> / ). But for dev, run, proc, sys - Linux is creating addition FS which is inferable from mount. $ ...
2
votes
1answer
159 views

zsh: check whether $PWD is on tmpfs mounted filesystem

I would like to change my zsh prompt color, if $PWD is currently on tmpfs mounted filesystem. Lets say for example, /dev/shm is a tmpfs filesystem. I can confirm that: $ grep /dev/shm /proc/mounts ...
0
votes
1answer
39 views

tab completion of /proc/self/fd/ shows different completions compared with listed contents

Using zsh, if I try tab completion of the following command ls /proc/self/fd/ then I see the following: files 0@ 1@ 10@ 11@ 12@ 13 2@ 3 However, when I press enter (without completing) I ...
2
votes
0answers
103 views

How to get unix socket inode given its path?

Let /var/run/mysqld/mysqld.sock/ be an open socket. I can stat it to get inode of the file (here 1200) # stat /var/run/mysqld/mysqld.sock File: /var/run/mysqld/mysqld.sock Size: 0 ...
3
votes
1answer
108 views

What's the meaning of [socket:number] in /proc/pid/fd

UNIX domain sockets opened by given $PID are listed in /proc/$PID/fd/X as symlinks to [socket:ID]. I understand that it's an identifier of that socket, but what exactly is it? Is it an inode in sockfs?...
1
vote
1answer
35 views

Will execute time of kernel thread will be included in /proc/[pid]/stat?

My process accesses a file in disk, which is mounted with iSCSI driver. I knew iSCSI has several kernel modules and some of them run as kernel threads. As my knowledge iSCSI needs a lot of CPU time, ...
0
votes
1answer
54 views

Emulate /proc folder

I've a software that uses a few nasty algorithms to determine, wether it runs in a docker container or not. One example is, that it scans /proc/1/cgroup for non root paths (i.e. /docker/SOME-UUID ...
0
votes
1answer
217 views

Documentation for the meaning of entries in /proc/meminfo and /proc/vmstat

Where can I find documentation explaining the meaning of entries in /proc/meminfo and /proc/vmstat files? I looked up on the web and the man page of proc but could not find much. Many entries are self ...
0
votes
1answer
40 views

What can a debugger do with /proc that cannot be done with ptrace?

The Wikipedia article on ptrace says: Communications between the controller and target take place using repeated calls of ptrace, passing a small fixed-size block of memory between the two (...
0
votes
1answer
620 views

kswapd0 in ubuntu slows down the system

We don't have any service running in the ubuntu but currently, we see the system becomes very slow from the morning, When I tried top command, I see there are two new services running like below, top ...
0
votes
1answer
34 views

Is there any way to recover files from the informations in `/proc`? [duplicate]

I have just asked in an interview that if someone mistakenly deletes apache logfile from /var/log/apache/access.log while it's being written, can you recover it? After my answer interviewer said that ...
1
vote
2answers
68 views

Detailed information on a single process in a greppable format

Utilities such as ps and top are good for looking at many processes side-by-side. However, they are inconvenient for examining many fields of a single process and are not amenable to using grep. For ...
0
votes
1answer
190 views

pidstat %CPU vs htop %CPU of a process

I'm using the pidstat to monitor the cpu usage of a process and it shows 100%. For the same process the htop or top shows 200% for the same process. The system has 16 cores, and the process i am ...
2
votes
1answer
224 views

How do I restore files removed from /usr/bin?

TL;DR at the bottom. Background: The following occured on my CentOS 6.10 production server. I was using a browser based terminal program to run the program Midnight Commander which is a console-...
0
votes
1answer
17 views

Does statting /proc/PID/stat make the kernel generate the contents so that a file size is returned?

I'm implementing an alternative to top, and thought that I should preallocate an appropriately sized buffer to hold the read contents of /proc/PID/stat. However, knowing that it's a pseudo filesystem ...
0
votes
1answer
87 views

How to determine active/passive end of TCP connection

If I inspect information about established TCP connections as returned by sock_diag(7) (or in /proc/net/tcp), how can I determine whether a given connection originated with the local side owning the ...
1
vote
1answer
285 views

permission denied, even when I have permission

This may be a dumb question, but how does symbolic link preserve permission? $ls -ld /proc/1/exe ls: cannot read symbolic link '/proc/1/exe': Permission denied so I look up what the link point to ...
3
votes
0answers
92 views

failure to stat /proc/self/map_files symlink - permission denied?

I am writing some code that checksums executable mappings. Through /proc/$PID/map_files, Linux provides symlinks to the files that back memory mappings. My code is calling "stat()" on one of these ...
0
votes
1answer
32 views

autofs --force unmounts /proc

Historically I've seen autofs get into situtations where systemctl restart autofs will hang indefinitely due to stale nfs handles. As a result I've employed the --force option to make autofs play a ...
1
vote
0answers
31 views

Identify filesystem for each mtd

In /proc/mtd I can see all partition in my device dev: size erasesize name mtd0: 0xxxxx00 0xxxxx00 "yyyy" mtd1: 0xxxxx00 0xxxxx00 "yyyy" mtd2: 0xxxxx00 0xxxxx00 "yyyy" How can I know which ...
0
votes
1answer
40 views

How does OS kernel get known connected hardware configuration to save it in `/proc` files?

In my student assignment I'm asked to track how Linux kernel discovers configurations of any device connected. For instance, the system has a new printer plugged in. As far as I can see, all features ...
21
votes
1answer
704 views

I accidentally backed up /proc/* , and now I'm stuck with a 28Tb file called “cifs2695” that I can't remove!

Recently my boss asked me to backup a Ubuntu 16 workstation. I wanted to preserve all the libraries and system files, since we have C++ code that can only compile on that particular machine. Being ...
-1
votes
1answer
25 views

What do drivers have to do with modules?

I need to research and find out "which drivers are loaded on my system" using /proc. In /proc there is a dir called "driver" so I thought that was it, but reading about it online, I saw I should also ...
2
votes
1answer
196 views

Why procfs mount option only working on remount?

I have written own init process (pid 1) for my system, to improve security I decided to add hidepid=2 while mounting procfs in /proc location (procfs not mounted by default). After mounting the ...
1
vote
1answer
68 views

how to query information from the /proc filesystem?

how would I begin to do this? I want to write a shell script file that would allow me to pull information from the proc filesystem. Information like PID, state of processes, etc... a short code demo ...
0
votes
1answer
47 views

How to find out what function is runnng when reading /proc

I am trying to write a kernel module that hides some sockets from netstat. I checked how netstat is working and saw that it's reading from /proc/net/tcp. Now I am stuck. I am trying to figure out ...
0
votes
1answer
182 views

What is the best way to restrict /proc fs from malicious users (linux)? [closed]

I am trying to make a restriction to procfs like only a certain groups of members can perform read and write actions. kernel document says we can do that by setting hidepid and gid in /etc/fstab. It ...
0
votes
1answer
110 views

Is “/proc/<pid>/map_files” include mapped file of all tid or just include mapped file of tid=pid only?

There is /proc/pid/task/tid/maps file but no corresponding /proc/pid/task/tid/map_files.

1
2 3 4 5
10