On other occasions I have already written about other interesting directories in LxA, even about the directory tree of GNU / Linux distributions. But this time, we are going to focus on a specific one. Its about / run directory, of which we are going to reveal all the details so that it does not have secrets for you. It may not be one of the most visited or popular directories, but it is quite important for the system ...
The new / run directory represents a small change in how Linux works with respect to temporary data at runtime. The new directory replaces / var / run in current distros. Now, / var / lock will also be found in / run / lock and / dev / shm in / run / shm, among other changes. To keep everything working properly, symbolic links are used for these directories. That way, there are no apparent changes for the old programs that depend on them.
You can use the following command to get information about the occupied space:
df -k /run
This lets us see that it is about a directory marked as tmpfs, that is, temporary. It is not actually stored on the hard drive, but rather in main memory or RAM. If you go to the directory, you will see some subdirectories and files inside:
cd /run
It is home to lots of data used at runtime. For example, you can see that inside / run / user there is a directory with a number for each user on the system:
cd /run/users ls -l
If you access the directory corresponding to your user, you will see that it contains data that the current running processes. Some have a * .pid extension with the name of the process to which they correspond. Like gdm3.pid, sshd.pid, etc. I invite you to use the concatenator to see the content of one of them. For example:
cat upstart-dbus-bridge.pid
And it will show the PID corresponding to said process. You can keep exploring other interesting ones like / run / sudo, / run / sshd, etc. As you can see, everything that is currently running has some residual or temporary data there ...
It's like telling the Windows user to open the Windows and system folder ...
Hi, I was wondering if there is any way to modify the files inside the /run directory. A few days ago my system broke, but I have a backup copy and I would like to return the data that was stored there.