I'd like to recursively convert soft links to hard links in a directory. I've tried something like this:
for f in *; do (mv $f{,~} && ln $(readlink $f~) && rm $f~) done
…but it has two major problems:
- not recursive
- picks up files that are not symbolic links
It would be nice to somehow feed the above line to find -type l
, but i'm not sure how to do that.
cp -aH
). [1]: unix.stackexchange.com/questions/94185/…