Linux下面究竟什么是symbolic link, 怎样创建一个symbolic link
2006-12-09 20:33
603 查看
A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file.
To create a symbolic link in Unix, at the Unix prompt, enter the following command:
ln -s source_file myfile
Replace
Note: If you delete the source file or move it to a different location, your symbolic file will not function properly. You should either delete or move it. If you try to use it for other purposes (e.g., if you try to edit or execute it), the system will send a "file nonexistent" message.
To create a symbolic link in Unix, at the Unix prompt, enter the following command:
ln -s source_file myfile
Replace
source_filewith the name of the existing file for which you want to create the symbolic link (this file can be any existing file or directory across the file systems). Replace
myfilewith the name of the symbolic link. The
lncommand then creates the symbolic link. After you've made the symbolic link, you can perform an operation on or execute
myfile, just as you could with the
source_file. You can use normal file management commands (e.g.,
cp,
rm) on the symbolic link.
Note: If you delete the source file or move it to a different location, your symbolic file will not function properly. You should either delete or move it. If you try to use it for other purposes (e.g., if you try to edit or execute it), the system will send a "file nonexistent" message.
相关文章推荐
- Linux下面究竟什么是symbolic link, 怎样创建一个symbolic link
- Linux下面究竟什么是symbolic link, 怎样创建一个symbolic link
- Linux -->在目录内创建文件、显示文件以及拷贝文件到一个目录都需要什么权限?
- Linux中想进入一个目录、 在目录下创建文件、在文件内部删除文件 各需要什么权限?
- Linux中想进入一个目录、 在目录下创建文件、在文件内部删除文件 各需要什么权限?
- linux下面怎样让给一个用户添加对指定文件夹写的权力
- Linux中想进入一个目录、 在目录下创建文件、在文件内部删除文件 各需要什么权限?
- 怎样不使用Useradd在linux下创建一个新的用户
- Linux 下创建一个文件,打开一个目录需要什么权限呢?
- linux中进入一个目录需要什么权限,在目录下创建文件需要什么权限
- Linux下面怎样可以把Apache网站根目录:/var/www/html/ 设置成Vsftp默认目录?
- Linux编程:创建一个只包含两个函数的小型静态函数库
- linux杂谈(八):如何手动的去创建一个linux用户
- Ubuntu下面的一个简单的C++程序——My first C++ demo in Linux
- 使用JavaBean创建您的网上日历本 有的朋友曾经说过,如果有一个网上的日记本,或者一个网上的万年历能提醒自己到时去干什么事情就好了。其实呀,这样的日历本您自己也能做一个。不信你看下面的例子: 〈
- 怎样创建真正很小的Linux下的ELF可执行文件
- 用maven create创建一个项目,只看到不停在downloading,不知道下载到哪里了,%MAVEN_HOME%里什么都没有。。
- 当你在 Linux 上启动一个进程时会发生什么?
- 什么是socket的name? 怎样给socket取一个name? --- 以生宝宝并取名的过程再谈socket、name、bind和socket name
- 作为一个新人,怎样学习嵌入式Linux