2011年2月21日 星期一

Linux Command - ln

Linux command - ln, create the hard-link or soft-link

standard usage includes the following syntaxs
ln [OPTION]... [-T] TARGET LINK_NAME (1st form)
ln [OPTION]... TARGET (2nd form)
ln [OPTION]... TARGET... DIRECTORY (3rd form)
ln [OPTION]... -t DIRECTORY TARGET... (4th form)

General Usage includes following

a. 1st command type example: create symblic link with specify-name in the specify directory (symbolic link name is differ with target)
# pwd
/tmp
# ln -sf ./mapping-root ./bbb
# ls -la
[omit]
[info-omit] 14 Feb 21 16:40 bbb -> ./mapping-root
[omit]

b. 3rd command type example: create symblic link with the same name with the target in the specify directory (symbolic link name is the same with target)

# ln -sf /tmp/aaa $HOME
# cd $HOME
# ls -la
[info-omit]
8 Feb 21 16:53 aaa -> /tmp/aaa ==>automatically generate the same name with the target in the specify directory ($HOME directory)
[omit]

沒有留言: