Apple - Is there any way to create a hard link in the finder?

You could create an Automator service like this:

enter image description here

This takes the selected files and creates hard links to them in the directory where they exist. You can then drag and drop the links to the location where you want them.

This will work for files with spaces in their names, but not for files containing quotation marks in their name.

You can access it from the Finder » Services menu, the context menu, and you can assign it a keyboard shortcut analogous to the L shortcut for aliases (perhaps L).


There's no way to do this in Finder.app itself. However, if your goal is just to avoid typing the commands into Terminal.app then you could use Automator.app to create a workflow to do the commands for you.


I actually wanted the link term in the rename with the extension preserved otherwise finder wouldn't recognize the filetype.

so I used Daniel's Answer(thanks for that) and changed it a bit

for f in "$@"
 do  
  dir=$(dirname "$f")
  filename=$(basename "$f")
  extension=$([[ "$filename" = *.* ]] && echo ".${filename##*.}" || echo '')
  filename="${filename%.*}"
  ln "$f" "${dir}/$filename Hardlink$extension"
done

EDIT: added what I think is better extension handling code - should be blank if no extension is present. Sorry, I am not good at coding scripts so please share any fixes you think this needs.

Tags:

Finder