Linux / UNIX create soft link with ln command
2013-08-02 10:21
316 查看
How to: Linux / UNIX create soft link with ln command
by NIXCRAFT on SEPTEMBER 25, 2007 · 42 COMMENTS· LAST UPDATED SEPTEMBER 25, 2007in DEBIAN / UBUNTU, FILE SYSTEM, FREEBSD
Q. How do I create a soft link (symbolic link) under UNIX or Linux operating system?
A. To make links between files you need to use ln command. A symbolic link (also known as a soft link or symlink) consists of a special type of file that serves as a reference to another file or directory. Unix/Linux like operating systems often uses symbolic links.
Two types of links
There are two types of linkssymbolic links: Refer to a symbolic path indicating the abstract location of another file
hard links : Refer to the specific location of physical data.
How do I create soft link / symbolic link?
To create a symbolic link in Unix or Linux, at the shell prompt, enter the following command:ln -s {target-filename} {symbolic-filename}
For example create softlink for /webroot/home/httpd/test.com/index.php as /home/vivek/index.php, enter the following command:
ln -s /webroot/home/httpd/test.com/index.php /home/vivek/index.php ls -l
Output:
lrwxrwxrwx 1 vivek vivek 16 2007-09-25 22:53 index.php -> /webroot/home/httpd/test.com/index.php
相关文章推荐
- 20+ Rsync command’s switches and common usages with examples – Unix/Linux--reference
- 15+ tar command usages with examples – Unix/Linux--reference
- 10+ commonly using find command switches with example Unix/Linux
- Linux / Unix Command: ImageMagick
- Execommand to create hyperlink
- pvresize - Unix, Linux Command
- Linux / Unix Command: getservbyname
- linux/unix command
- Linux文件和目录的操作(十三) 硬软链接 ln(link)
- dmraid - Unix, Linux Command
- 编译Linux内核错误:ln: creating symbolic link `include/asm': Operation not supported
- Linux install python lxml error: command ‘gcc’ failed with exit status 1
- OSX “open” command to create new files with an app
- [Practical Git] Navigate git command pager output with Unix less commands
- Linux: ln command
- Linux/Unix lsof command
- Linux ln command
- Explain: Linux and UNIX TCP Wrappers – Find Out If a Program Is Compiled With TCP Wrappers
- error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
- Linux / Unix Command: packet