Show folder as volume.

Mount a folder as volume on MacOS.

I want to use a folder in Visual Studio Code but not expose the full path (including username) in my online tutorials. I cannot create a folder in the root but I can create a symlink in the volume folder.

The symlink link command has the following structure

ln -s target_file_or_folder link_name

I create physical folder here:

~/dev/tutorialcode/

And create the symlink like this:

ln -s ~/dev/tutorialcode/ /Volumes/dev

/Volumes list:

lrwxr-xr-x   1 root  wheel    1 Aug  2 21:33 Macintosh HD -> /
lrwxr-xr-x   1 root  wheel   33 Aug  3 15:00 dev -> /Users/***/dev/tutorial

If you get error 'Permission denied', you might have to use sudo. Do it on your own risk!

Written by Loek van den Ouweland on 2024-08-03.
Questions regarding this artice? You can send them to the address below.