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 analyze the directory structure in Linux system

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

Share

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

How to analyze the directory structure in Linux system? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

In Linux system, all files and directories are tree structure based on "/" node, which is very different from Windows.

Linux directory structure / root partition, only root users have write access to this directory.

/ etc configuration file

/ boot startup file

/ var can grow the directory. Logs, files, etc.

/ root administrator the home directory of all data root users.

/ tmp temporary files (about once every 15 days. )

/ usr unix software source / usr/src source code directory. / usr/local 's own software installation location.

/ bin command binary executable.

/ sbin system commands.

/ mnt mount directory.

/ dev device file. Everything is files, terminals, disks, etc. Keyboard, mouse, etc.

/ home normal user file storage location.

/ proc virtual directory. You can view the status of each process.

/ lib stores the library files of the system (dynamic library, static library. .a static library, .so dynamic library). Similar to .dll files.

Absolute path and relative path absolute path starts from /.

The relative path is based on. .. It started.

Create, delete copy file touch a.txt create a file

Mkdir test creates a directory

[root@local ~] # cat a.txt hello linux View File

[root@local ~] # less / var/log/messagesless can be viewed from top to bottom. Enter, the spaces are the next page. Q exit view.

[root@local ~] # more / var/log/messagesmore can only be viewed by turning the page down.

[root@local ~] # cat / var/log/messagescat displays all the content at once.

[root@local] # tail-n 10 / var/log/messages Jan 5 15:30:01 local systemd: Started Session 14 of user root. Jan 5 15:30:01 local systemd: Starting Session 14 of user root. Jan 5 15:40:01 local systemd: Started Session 15 of user root. Jan 5 15:40:01 local systemd: Starting Session 15 of user root. Jan 5 15:50:01 local systemd: Started Session 16 of user root. Jan 5 15:50:01 local systemd: Starting Session 16 of user root. Jan 5 16:00:01 local systemd: Started Session 17 of user root. Jan 5 16:00:01 local systemd: Starting Session 17 of user root. Jan 5 16:01:01 local systemd: Started Session 18 of user root. Jan 5 16:01:01 local systemd: Starting Session 18 of user root.tail the last number of lines.

[root@local] # head-n 10 / var/log/messages Jan 2 16:17:58 local rsyslogd: [origin software= "rsyslogd" swVersion= "7.4.7" x start Jan pid= "887" x local journal = "Runtime journal is using start Jan 2 16:17:47 local journal: Runtime journal is using 8.0m (max allowed 99.2m, trying to leave 148.9m free of 984.9M available → current limit 99.2m). Jan 2 16:17:47 local journal: Runtime journal is using 8.0m (max allowed 99.2m) Trying to leave 148.9m free of 984.9M available → current limit 99.2m). Jan 2 16:17:47 local kernel: Initializing cgroup subsys cpuset Jan 2 16:17:47 local kernel: Initializing cgroup subsys cpu Jan 2 16:17:47 local kernel: Initializing cgroup subsys cpuacct Jan 2 16:17:47 local kernel: Linux version 3.10.0-327.el7.x86_64 (mockbuild@x86-034.build.eng.bos.redhat.com) (gcc version 4.8.3 20140911 (Red Hat 4.8) .3-9) (GCC) # 1 SMP Thu Oct 29 17:29:29 EDT 2015 Jan 2 16:17:47 local kernel: Command line: BOOT_IMAGE=/vmlinuz-3.10.0-327.el7.x86_64 root=UUID=87b51ffa-2f57-4ac2-99e7-e491bb257520 ro rhgb quiet LANG=zh_CN.UTF-8 Jan 2 16:17:47 local kernel: Disabled fast string operations Jan 2 16:17:47 local kernel: E820: BIOS-provided physical RAM map:head how many lines to start.

[root@local] # tail-f-n 10 / var/log/messages Jan 5 15:30:01 local systemd: Started Session 14 of user root. Jan 5 15:30:01 local systemd: Starting Session 14 of user root. Jan 5 15:40:01 local systemd: Started Session 15 of user root. Jan 5 15:40:01 local systemd: Starting Session 15 of user root. Jan 5 15:50:01 local systemd: Started Session 16 of user root. Jan 5 15:50:01 local systemd: Starting Session 16 of user root. Jan 5 16:00:01 local systemd: Started Session 17 of user root. Jan 5 16:00:01 local systemd: Starting Session 17 of user root. Jan 5 16:01:01 local systemd: Started Session 18 of user root. Jan 5 16:01:01 local systemd: Starting Session 18 of user root. Jan 5 16:03:51 local systemd-logind: New session 19 of user root. Jan 5 16:03:51 local systemd: Started Session 19 of user root. Jan 5 16:03:51 local systemd: Starting Session 19 of user root. Jan 5 16:03:51 local dbus: [system] Activating service name='org.freedesktop.problems' (using servicehelper) Jan 5 16:03:51 local dbus-daemon: dbus: [system] Activating service name='org.freedesktop.problems' (using servicehelper) Jan 5 16:03:51 local dbus: [system] Successfully activated service 'org.freedesktop.problems' Jan 5 16:03:51 local dbus-daemon: dbus [887]: [system] Successfully activated service' Org.freedesktop.problems'tail-f dynamically views the data. This is very practical.

[root@local ~] # rm-r test2 rm: delete the directory "test2"? Y [root@local ~] # rm-rf testrm-r includes subdirectories, and-f forces deletion.

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

The answer to the question on how to analyze the directory structure in the Linux system is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

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

Development

Wechat

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

12
Report