Where do you put your one-off binaries and shell/python/ruby/etc. scripts?

  • /usr/local/bin
  • ~/opt/bin
  • ~/.local/bin
  • ~/bin
  • Other (comment please)

0 voters

I have voted /usr/local/bin … but seeing your avatar thought I’d share my recent one

3 Likes

I made a /Scripts folder in my user folder. So when I’m moving to a new OS or new machine, it’s sitting right there.

3 Likes

Nice!

1 Like

~/Dropbox/bin

Used to be ~/bin, but that was in the precloud days.

1 Like

If you are referring to scripts and binaries that I have written myself, I have a folder in one of my SynologyDrive folders called bin; so basically it’s at /Users//SynologyDrive/bin where all of these things live. I have /Users//bin symlinked to it for convenience as well.

If you are talking about things downloaded from elsewhere like homebrew, that stuff would go where ever those projects put their stuff.

None, they go in my git-versioned scripts folder. Why put one-offs into a repo? Because I sometimes find out later I need it again, or I need a modified version of it, etc

In ~/bin, which is symlinked to a git repo with all my dot files.

But that’s for shell stuff, AppleScript one offs live inside wherever Keyboard Maestro stores them.

1 Like

one fourth of my cli binaries are from homebrew, because it’s easier to compile or/and the project don’t provide binary release. also the man page just works

other than that, in a ~/.tool_binaries/ directory symlinked to /usr/local/bin for non-homebrew. each time I download a binary release of cli tool (say, bat), I use this Keyboard Maestro macro to automatically remove quarantine xattr, set file owner to me, move the file to ~/.tool_binaries and offer to add symlink to /usr/local/bin:

Finder- Move to Tool Binaries.kmmacros (13 KB)

1 Like

As a developer, I have a ~/code folder. I’d recommend the following:

  1. ~/code is easier to type and in home directory where user files should be located.
  2. Backup those files in something like GitHub, you can have all those scripts under one directory that you just version control (for example ~/code/scripts).

Because this is specifically about scripts, I would expand beyond the original question. Developers usually store their dot_files, in a dot_files repo, like .vimrc or .bashrc. I think scripts can also be stored in similar repo and directory.