访问手机版  

Linux常用命令|Linux培训学习|考试认证|工资待遇与招聘,认准超级网工!

招聘|合作 登陆|注册

网络工程师培训

当前位置:网络工程师 > 技术课程 > linux > 热点关注 > linux常用命令

linux ln 命令详解

时间:2019-08-16

linux命令大全_linux shell 命令 大全_linux命令大全 重启

本文章更新于 2017.11.12,如果本节更新内容与下面小节的内容不一致,以这个小节为准。

As the saying goes, a picture is worth a thousand words. Here is how I visualize it:

If%20you%20don’t%20know%20what%20inode%20is,%20please%20refer%20to%20wikipedia%20page%20about%20it.%20The%20picture%20above%20tells%20us%20a%20hard%20link%20just%20creates%20another%20file%20with%20a%20link%20to%20the%20same%20underlying%20inode.%20Therefore,%20if%20you%20want%20to%20delete%20the%20inode,%20then%20you%20have%20to%20delete%20all%20the%20links%20to%20it.%20For%20a%20soft%20link,%20if%20you%20delete%20or%20rename%20myfile.txt%20will%20invalidate%20it%20and%20cause%20it%20can’t%20find%20inode.%20Let%20me%20show%20you%20an%20example.%20You%20will%20understand%20it%20deeply.

I created a directory named lnte in my Ubuntu os and printed its apparent sizes in byte by typing following command:

du -b lnte

And you would see that it take up 4096 bytes. As shown in the picture below, you may find that a hard link doesn’t occupy any space on disk whereas a soft link indeed consumes 5-bytes space.

首先,我在我的target目录下创建了文件lovedog.txt,并写了一行文字,如下图:

linux shell 命令 大全_linux命令大全 重启_linux命令大全

当我们去target目录中看lovedog.txt文件时,内容也发生了变化。同样的道理,我可以创建很多个软链接指向lovedog.txt,如下图:

该控件有很多自己的属性,而串口只能做异步访问,只是在windows%209x下磁盘文件只能做同步访问,串口和磁盘文件可以统一的方式来简单读写。-l%20如果指定了%20-r%20或%20-r%20选项,并且引用文件类型目录的符号链接在命令行上指定或在文件层次结构转移过程中遇到linux命令大全,则%20grep将搜索符号链接所引用的目录文件以及文件层次结构中在它以下的所有文件。让您理解文件系统的作用,能够区分ext3,ext4,xfs有何不同并学习将硬盘设备分区、格式化以及挂载等常用硬盘管理操作,完整配置swap交换分区、quota服务限制磁盘配额、ln命令创建软/硬链接、管理raid磁盘冗余阵列(0、1、5和10模式)、lvm逻辑卷管理器并能够熟练掌握创建软/硬链接的方法,学习了解vfs原理。

我们可以通过下图的命令来创建硬链接:

 上一个教程:linux 命令 stat 详解