简体   繁体   中英

How to use “ln” create link for directories on linux?

I tried linux command line "ln", seems it couldn't do this:

mkdir -p test1/test2/test3
ln -s test4 test1 #I wish to create test4 as symbolic link to test1
find test4

The result is weird:

$ls test1
test2 test4

Well, test4 is a subdirectory of test1, not a link to test4.

It didn't achieve what I expected. How should I achieve this? Thanks a lot.

You change the position of arguments ln [-fiqRrv] old new . The first position is original file/folder e the second is the symbolic link. Try this, that will create a symbolic link in test4 to test1

ln -s test1 test4

more in : ln documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM