The Linux / run directory

Linux main directory tree

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,, etc. I invite you to use the concatenator to see the content of one of them. For example:


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 ...

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

2 comments, leave yours

Leave a Comment

Your email address will not be published.



  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Alpercon said

    It's like telling the Windows user to open the Windows and system folder ...

  2.   alex said

    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.