Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239241
  • 博文数量: 91
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 955
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-12 09:38
文章分类

全部博文(91)

文章存档

2017年(1)

2011年(1)

2008年(15)

2007年(74)

我的朋友

分类: LINUX

2007-08-23 17:58:04

symbolic links
   a symbolic link is really a tiny file that contains a pointer to another file.when linux opens a symbolic link, it reads the pointer and then finds the intended file that contains the actual data.symbolic links can point at the other filesystems, both local and on network computers,and they can point to the directories.they are clearly listed as being a link with the ls -l command by display a special "l"(a lowercase L) in column one, and they have no file protections of their own(the actual file permissions are used instead).note that if a file with a symbolic link is deleted,then the symbolic link points to nothing and is said to be stale.
   hard links
    a hard links is not really a 'link' at all,but a copy of another directory entry.the two directory entries have different names but point to the same inode and to the same actual data,ownership,permission, and so on.in fact,if a file with a hard link is deleted,the link remains,still pointing to the value inode.except for its name, including its location in the directory hierarchy,the link is indistinguishable from the original file.hard links have two importations.first,because they share inodes.file and any hard links to them must reside(居留,属于,) on the same filesystem(inode numbers aren't expected to be unique across filesystems). second.hard links cannot point to directories. however, hard links take no disk space beyond an additional directory entry.
    symbolic links are used more often than hard links because they are more versatile and easier to manage,yet still consume a trivilal amount of disk space.
    
ln
   ln [options] file link
   create links between files.in the first form,a new links in created to point to file,which must already exist.in the second form,links are created in directory for all files specified.
   -f overwrite(force) existing links, or existing files in the destination directory.
   -i prompt interactively before overwriting destination files
   -s create a symbolic link rather than a hard link.
   ln -l /bin/bash /bin/sh

阅读(1213) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~