Skip to content

Instantly share code, notes, and snippets.

@mapk0y
Created July 9, 2015 09:45
Show Gist options
  • Save mapk0y/97b0bbd24c6cb46fbb7e to your computer and use it in GitHub Desktop.
Save mapk0y/97b0bbd24c6cb46fbb7e to your computer and use it in GitHub Desktop.
symlink と hardlink
root@debian:~# touch original
root@debian:~# touch normal
root@debian:~# ln -snvf original symlink
'symlink' -> 'original'
root@debian:~# ln -nvf original hardlink
'hardlink' => 'original'
root@debian:~# for i in *;do echo [${i}];test -L ${i};echo "test: $?";echo "stat:" $(stat -c %h ${i});done
[hardlink]
test: 1
stat: 2
[normal]
test: 1
stat: 1
[original]
test: 1
stat: 2
[symlink]
test: 0
stat: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment