linux 软链接与硬链接
来源:互联网 发布:印度软件外包 编辑:程序博客网 时间:2024/05/21 17:58
https://www.ibm.com/developerworks/cn/linux/l-cn-hardandsymb-links/index.html
- 这里对linux文件系统作了很全面的解释,简而言之,linux文件数据的唯一标识是inode号包含在元数据(metadata)中,文件系统包含一个(我猜是hash表)索引提供文件路径的方式访问真正的userdata。
- 当我们通过文件名访问文件时,linux会先查找到inode号对应的metadata,再进行一系列操作。
硬链接
硬链接是一个inode标示文件的不同别名
可以使用ls -i 和stat来查看元数据
创建方法:
# ln old.file hard.link //或者 link old.file hard.link ls -li total 8 660650 -rw-r--r-- 2 root root 25 Sep 1 17:44 hard.link 660650 -rw-r--r-- 2 root root 25 Sep 1 17:44 old.file
- 硬链接文件具有和源文件相同的 inode和datablock;
- 只能对已存在的文件创建硬链接;
- 不能交叉文件系统创建硬链接;
- 不能对目录创建硬链接(. .. 这两个除外);
- 删除硬链接只是将对应的inode指向文件的metadata中的link字段减一;
- 文件权限完全相同;
软链接
转链接是一个普通文件,数据块的内容是另一个文件的路径
示例:
# ln -s old.file soft.link # ls -liF total 0 789467 lrwxrwxrwx 1 root root 8 Sep 1 18:00 soft.link -> old.file
- 可以对不存在的文件或目录创建软连接
- 指向目标不存在的软链接成为死链接
- 软链接文件有这自己的inode号和独立的权限;
阅读全文
0 0
- Linux 硬链接与软链接
- Linux 硬链接与软链接
- Linux 硬链接与软链接介绍
- Linux 硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接区别
- linux硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接区别
- linux硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接
- linux硬链接与软链接
- linux的软链接与硬链接
- linux硬链接与软链接
- 美素数
- tomcat(web服务器)加载前端代码和后台代码原理
- Windows下sublime text3 配置python开发环境
- Spring redis key乱码
- html5的file api以及配合spark-md5获取文件md5值
- linux 软链接与硬链接
- Https 与 SSl证书 概要
- flume高并发优化——(14)解决空行停止收集数据问题,及offsets变小问题
- ProgressBar初识
- iOS之指纹解锁
- 微信公众平台-openid获取
- 打印顺序——2017华为招聘机试题
- BZOJ 3555 企鹅QQ [哈希]
- 独热编码(One-Hot Encoding)及在CNN中的应用