Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use / run on Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use / run on Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Small but significant changes have taken place in the way Linux systems work in terms of runtime data.

If you don't pay close attention, you may not have noticed some small but significant changes in the way Linux systems work with run-time data. It reorganizes the accessible ways and locations in the file system, a change that began about eight years ago. While this change may not be enough to make your socks wet, it provides more consistency in the Linux file system and is worth exploring.

To get started, go to / run. If you use df to check it, you will see output like this:

$df-k .Filesystem 1K-blocks Used Available Use% Mounted ontmpfs 609984 2604 607380 1% / run

It is recognized as a "tmpfs" (temporary file system), so we know that the files and directories in / run are not stored on disk, but only in memory. They represent data stored in memory (or disk-based swap space), and it looks like a mounted file system, which makes it easier to access and manage.

/ run is home to all kinds of data. For example, if you look at / run/user, you will notice a set of directories with numeric names.

$ls / run/user1000 1002 121

You can find the importance of these numbers by using a long list of files.

$ls-ltotal 0drwx-5 shs shs 120 Jun 16 12:44 1000drwx-5 dory dory 120 Jun 16 16:14 1002drwx-8 gdm gdm 220 Jun 14 12:18 121

We see that each directory is related to the currently logged-in user or the display manager gdm. The numbers represent their UID. The contents of each directory are files used by running processes.

The / run/user file is only a small part of what you find in / run. There are a lot of other documents. There are some files that contain process ID for various system processes.

$ls * .pidacpid.pid atopacctd.pid crond.pid rsyslogd.pidatd.pid atop.pid gdm3.pid sshd.pid

As shown below, the sshd.pid file listed above contains the process ID of the ssh daemon (sshd).

$cat sshd.pid1148 $ps-ef | grep sshdroot 1148 10 Jun14? 00:00:00 / usr/sbin/sshd-D / run/lockdrwxrwxr-x 17 root syslog 4096 Jun 17 00:00 logdrwxrwsrwt 2 root mail 4096 Jun 13 12:10 maildrwxrwsrwt 2 root whoopsie 4096 Jan 5 2018 metricsdrwxr-xr-x 2 root root 4096 Jan 5 2018 optlrwxrwxrwx 1 root root 4 May 14 2018 run-> / rundrwxr-xr-x 9 root root 4096 Jun 16 2018 snapdrwxr- Xr-x 9 root root 4096 Jun 9 15:14 spooldrwxrwxrwt 8 root root 4096 Jun 17 00:00 tmpdrwxr-xr-x 3 root root 4096 Jan 19 12:14 www

Although the technical change is small, the transition to / run is only for better organizing runtime data in the Linux file system.

The above is all the contents of the article "how to use / run on Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report