Linux hard link and soft link directory structure

Source: Internet
Author: User

Understanding hard links and soft links for Linux

Directory structure

/              根目录 ├── bin     存放用户二进制文件 ├── boot    存放内核引导配置文件 ├── dev     存放设备文件 ├── etc     存放系统配置文件 ├── home    用户主目录 ├── lib     动态共享库 ├── lost+found  文件系统恢复时的恢复文件 ├── media   可卸载存储介质挂载点 ├── mnt     文件系统临时挂载点 ├── opt     附加的应用程序包 ├── proc    系统内存的映射目录,提供内核与进程信息 ├── root    root 用户主目录 ├── sbin    存放系统二进制文件 ├── srv     存放服务相关数据 ├── sys     sys 虚拟文件系统挂载点 ├── tmp     存放临时文件 ├── usr     存放用户应用程序 └── var     存放邮件、系统日志等变化文件Soft/hard link access in UNIX systems, the operating system designs a set of common APIs for I/O operations such as text and images on disk, mouse and keyboard input devices, and network interaction, so that they can be processed uniformly using a byte stream. Other wordsUeverything except the process in the NIX system is a file,And Linux retains this feature. To facilitate file management, Linux also introduces the concept of catalogs (sometimes referred to as folders). Directories allow files to be managed by classification, and the introduction of directories enables Linux file systems to form a hierarchical directory tree. The inode is part of the metadata file that is divided into two sections on Linux:user data and meta data (metadata). User data, which is the file block (data block), is where the real content of the file is recorded, while metadata is an attached property of the file, such as file size, creation time, owner, and so on. View Inode numbers can be used with command stat or ls-i hard links with soft links (also known as symbolic links, soft link or symbolic link)/s?m ' b?l?k symbolic, symbolic

A hard link has the following characteristics:

    • The file has the same inode and data block;
    • Only files that already exist can be created;
    • Cannot cross file system for hard link creation;
    • The directory cannot be created, only the file can be created;
    • Deleting a hard-link file does not affect other files that have the same inode number.

A soft link has the following characteristics:

    • Soft links have their own file attributes and permissions, etc.;
    • You can create a soft link to a nonexistent file or directory;
    • Soft link can cross file system;
    • Soft links can be created on files or directories;
    • When you create a soft link, the link count i_nlink not increase;
    • Deleting a soft link does not affect the file being pointed to, but if the original file being pointed to is deleted, the associated soft connection is called a dead link (that is, dangling link, if it is re-created by pointing to the path file, the dead link can revert to the normal soft link).

Linux hard link and soft link 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.