DEV Community

Discussion on: Beginner’s Guide to Executables and Where To Store Them

Collapse
 
moopet profile image
Ben Sinclair

I think there's a mistake in your first example - it looks like you skipped ahead a step, because the error message and command refer to different paths:

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
-bash: /usr/local/bin/subl: No such file or directory

If it's just something for you, not something for all users, then putting it into ~/bin like Sublime suggests is probably a better idea. You'll usually have to add $HOME/bin to your PATH, but that's a one-off change, and it'll set you up for knowing how to install things on environments where you're not the owner, like shared hosting or generally any foreign system.

If you're downloading something then being able to install it without having root is good because in my opinion, waaaay too many tutorials and whatnot expect you to copy-paste commands starting with sudo whether they need root permissions or not, and I've seen a lot of people just end up using it as a hammer to fix every bent nail.

Also worth checking out is the install command, which handles a lot of this for you but copies the files instead of linking them. Too many symlinks in /usr/local/bin means that after a while, as your machine gets older, you're likely to run into some broken ones from when you thought you'd tidy up all those install files into an old_programs directory.

Collapse
 
hbalenda profile image
Hannah Balenda • Edited

Ah, you're right, it should've been "command not found". And right about adding ~/bin to my $PATH, I hadn't done that yet setting up the new computer, and never really understood why I should do that, but now I get it! Thank you so much, I'm updating the post to reflect this.