Path to user directory when username is unknown

by Josh   Last Updated September 11, 2019 16:12 PM

Some colleagues and I have our cloud storage (e.g. Dropbox) syncing to our macs.

The local path to a particular folder in our synchronised cloud storage looks like /Users/{$USERNAME}/CloudSync/Projects/Hello World/

When we share links with each other we currently share the links provided by our cloud service which opens the app or website to view them. It would be great if we could just share a path to our local copies with each other, but obviously I don't want to have to manually type their usernames into the path each time. Is there some sort of alias for username that can be used instead?

Answers 1

The standard path to /Users/[current user] is tilde ~

So the path to /Users/{$USERNAME}/CloudSync/Projects/Hello World/ for any user is

~/CloudSync/Projects/Hello World/

September 11, 2019 15:47 PM

Related Questions

Updated July 11, 2015 17:05 PM

Updated February 25, 2016 02:05 AM

Updated August 11, 2016 08:05 AM

Updated November 23, 2018 15:12 PM

Updated August 22, 2018 21:12 PM