The characteristics of Linux Basic Learning -6.1-directory structure

Source: Internet
Author: User
Tags gpg

first, the Windows directory structureThere are several partitions on windows that have several roots

C:\Windows

D:\Program Files

E:\pycharm

F:\video

Ii. Development of UNIX directories

In 1969, Ken Thompson and Dennis Ritchie invented Unix on minicomputer PDP-7. 1971, they upgraded the mainframe to PDP-11

At the time, they used a storage disk called RK05, which was about 1.5MB in size.

Because the capacity of the hard disk is very small, it is not long before the operating system storage disk data (root directory) is getting bigger and larger, resulting in a disk can not fit the data. As a result, they added a second disk RK05, and made the rules, the first disk dedicated to storing system-related programs, the second disk dedicated to the user's own program, so the mount directory named/usr

That is, the root/mount on the first disk,/USR is mounted on the second disk. In addition, the other directory structures in the two disks are identical

First Plate/BIN/SBIN/LIB/TMP

Second Plate/usr/bin/usr/sbin/usr/lib/usr/tmp

[Email protected] ~]# ls-ld/bin//sbin//tmp//usr/bin//usr/sbin//usr/tmp/

Dr-xr-xr-x. 2 root root 4096 May 1 13:24/bin/

Dr-xr-xr-x. 2 root root 12288 May 1 13:24/sbin/

DRWXRWXRWT. 3 root root 4096 May 8 09:43/tmp/

Dr-xr-xr-x. 2 root root 28672 May 7 21:35/usr/bin/

Dr-xr-xr-x. 2 root root 12288 May 1 13:24/usr/sbin/

DRWXRWXRWT. 2 root root 4096 May 7 21:35/usr/tmp/

Third, Linux directory 1, linux directory mechanism

Linux directory: Everything starts at the root,/is the starting point (vertex) of all directories: relative and absolute paths

The directory structure and device are detached, and any directory may correspond to a different disk or partition

Different directories in a Linux system can be distributed across different disk partitions and on different disks, and different partitions in the Windows system exist independently.

Linux disk devices are inaccessible by default (black room), no windows, no doors.

The process of opening the window is mounted, the doors and windows are equivalent to the catalogue, called Mount point/mnt

I, mounted command mount

Mount/dev/cdrom/mnt

II. View Mount Status:

Df-h

Cat/proc/mounts

III. Automatic mount on Boot:

/etc/fstab

2, device mount and unload mount

[Email protected] ~]#

[Email protected] ~]# mount/dev/cdrom/mnt/

Mount:block Device/dev/sr0 is write-protected, mounting read-only

[Email protected] ~]# # # # #查看

[[email protected] ~]# DF

Filesystem 1k-blocks used Available use% mounted on

/dev/sda3 9213440 1446572 7292196 17%/

Tmpfs 953128 0 953128 0%/dev/shm

/DEV/SDA1 194241 40020 143981 22%/boot

/dev/sr0 3878870 3878870 0 100%/mnt

[Email protected] ~]# df-h

Filesystem Size used Avail use% mounted on

/dev/sda3 8.8G 1.4G 7.0G 17%/

Tmpfs 931M 0 931M 0%/dev/shm

/DEV/SDA1 190M 40M 141M 22%/boot

/dev/sr0 3.7G 3.7G 0 100%/mnt

[Email protected] ~]# cd/mnt/

[[email protected] mnt]# ls

Centos_buildtag Isolinux rpm-gpg-key-centos-debug-6

EFI Packages rpm-gpg-key-centos-security-6

EULA release-notes-en-us.html rpm-gpg-key-centos-testing-6

GPL Repodata TRANS. TBL

Images rpm-gpg-key-centos-6

[Email protected] mnt]# ls-l

Total 564

-r--r--r--. 2 root root Mar 02:05 Centos_buildtag

Dr-xr-xr-x. 3 root root 2048 Mar 02:19 EFI

-r--r--r--. 2 root root 212 Nov EULA

-r--r--r--. 2 root root 18009 Nov GPL

Dr-xr-xr-x. 3 root root 2048 Mar 02:24 images

Dr-xr-xr-x. 2 root root 2048 Mar 02:19 Isolinux

Dr-xr-xr-x. 2 root root 534528 Mar 02:23 Packages

-r--r--r--. 2 root root 1359 Mar 23:53 release-notes-en-us.html

Dr-xr-xr-x. 2 root root 4096 Mar 02:24 Repodata

-r--r--r--. 2 root root 1706 Nov rpm-gpg-key-centos-6

-r--r--r--. 2 root root 1730 Nov rpm-gpg-key-centos-debug-6

-r--r--r--. 2 root root 1730 Nov rpm-gpg-key-centos-security-6

-r--r--r--. 2 root root 1734 Nov rpm-gpg-key-centos-testing-6

-r--r--r--. 1 root root 3380 Mar 02:24 TRANS. TBL

Unloading

Umount/mnt or Umount/dev/cdrom

3. Summary

I, everything starting from the root, all documents

II. The device under Linux is not mounted and cannot be used

III, mount = = = Give the device an entrance

IV, mount point = = = Device

V, relative path absolute path

Tip: The old boys training learning ideas, practice the ability to summarize, the book from thick thinning (first summed up and then expanded) exercises:

1, the Linux directory mechanism

2, how to mount and uninstall the device? Qddddqq

Press h to open a hovercard with more details.

The characteristics of Linux Basic Learning -6.1-directory structure

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.