info
-
ln
creates links between files -
ln option target linkname
-
ln
creates a link to filetarget
-
with the name
linkname
-
ln
createshard links
by default -
-s
or--symbolic
for symbolic links
-
demo
-
create file and link
# create a file `a` $ echo "hello" > a # create `hard link` # called `b` to `a` $ ln a b # create `soft link` # called `c` to `a` $ ln -s a c
-
printing the contents
$ cat a hello $ cat b hello $ cat c hello
-
remove file
a
$ rm a
-
printing the contents again
$ cat a cat: a: No such file or directory $ cat b a $ cat c cat: c: No such file or directory