首页 > 代码库 > Unix command 积累
Unix command 积累
1,basename, 当向basename传递一个路径名时,它会删除任何前缀,直到最后一个斜线(‘/‘
)字符,然后返回结果。
$ basename /home/jsmith/base.wiki base.wiki
2, symbolic link
就是一个已有文件的别名
In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path. Programs that read or write to files named by a symbolic link will behave as if operating directly on the target file.
ln -s target_path link_path
3, Hard links always refer to an existing file.
A file in the file system is basically a link to an inode.
A hard link then just creates another file with a link to the same underlying inode.
deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
$ ln /tmp/file link-here
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。