As a developer, I’ve kept my coding projects under a consistent, easy-to-reference directory for years. It makes accessing files simple and fast when I’m in the terminal. For me, that directory has long been ~/Dev
. It’s short and quick to type when entering commands.
To make it just as useful in Finder and other GUI-based tools, I’ve added it to the Finder sidebar, complete with Apple’s built-in dedicated icon for development folders.
But, what about /dev?
You might wonder if naming your development directory “Dev” is a bit too close to the system-level /dev
used by all Unix-based systems, and that’s definitely a fair concern.
My use of “Dev”, as an abbreviation for “Development”, long predates my switch from Windows to macOS in 2011. As the old saying goes, “old habits die hard”. Personally, I’ve never had any confusion or conflicts. Still, you can name the folder anything that works for you. Perhaps “Code”, “Projects” or “Work” is more to your liking. I just recommend you keep it short and easy to type at the command line.
Set Up the Directories
To get the custom icon in Finder, macOS looks specifically for a directory named “Developer”, even if this isn’t what we want to call it. Here’s how to set it up using our own name for it:
- Create a
Developer
directory
Adding this to your home directory is what enables the special Finder icon.
mkdir ~/Developer
- Create a symlink
Link your preferred folder name (e.g.Dev
) to theDeveloper
directory.
ln -s ~/Developer ~/Dev
- Hide the original
Keep your home directory clean by hiding theDeveloper
folder.
chflags hidden ~/Developer
Add It to the Finder Sidebar
Now you’ve got a clean, quick-access development folder for all your work files. To make it just as easy to use in Finder, open Finder and then drag ~/Dev
into the sidebar. macOS will create a new sidebar entry for it, and since it’s a symlink to Developer
, it will show Apple’s development icon, which is a hammer.
iCloud Backups (optional)
My actual project files are stored under ~/Documents/Projects
, where macOS can sync them to iCloud. This gives me an extra layer of backup. I also organize projects from there by groups, such as “blogs”, or by client. Many projects have multiple subdirectories, often where only one might contain code. I only need to link to that one in ~/Dev
to keep things clean.
For example, all files related to the Verbosian site live in various subdirectories. All of them reside here, although only one contains the site’s code:
~/Documents/Projects/Blogs/Verbosian
But from the terminal, I can access the code for the site directly, using:
~/Dev/websites/verbosian
This keeps things organized and gives me fast access to the files I need for development.