Sublime Forum

How to Do Terminal and Command Line Integration

#1

I’m using Wes Bos’s book, Sublime Text Power User. I’m using ST3. Just paid for a license. Woo-hoo!

Except, I’m on the chapter about Terminal and Command Line integration, and…it’s not working, including with the sudo command.

sudo ln -s “/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl” /bin/subl

With the sudo command, Terminal is telling me I don’t have permission.

I’m the only user for my computer, and therefore the admin. I’m using Sierra. I know enough about Terminal to probably not brick my computer.

Can anyone help me, please?

0 Likes

#2

That seems to work OK for me here.

Presuming that more recent versions of MacOS (I’m running 10.10) haven’t removed the /bin/ directory for some reason, the first thing that immediately springs to mind is that you don’t have the root user enabled on your system. If I recall correctly it’s disabled by default, so I would guess that perhaps the sudo command as outlined above won’t work because it doesn’t have the appropriate user.

I think this might also be caused by not having a password defined for your account (for security reasons), so that might be something to check as well.

1 Like

#3

Oh yeah!! Access to the bin directory was removed with Sierra! Thanks for jogging my memory!

2 Likes

#4

How did you do to fix that? Disabled csrutil?

0 Likes

#5

I don’t think there is a way around it. I did install the Terminal
Package though, but I’m too new at this to know if it will help. Apple has walled off /bin/.

0 Likes

#6

Is /usr/bin still accessible? If so I would recommend using that instead of /bin, as it should still probably be in your path by default.

0 Likes

#7

I recommend using the /usr/local/bin directory for these things, because you can write to it (with recent versions I believe), and the OS won’t touch that directory.

3 Likes

#8

I would (and actually do) use /usr/local/bin for this because that’s what I’m used to on all of my Linux machines as well.

For clarity the only reason I didn’t also suggest that above is that (as far as I can remember) it’s not added to your path by default, so you still need to perform some magic jiggery to get things to work as expected, which might not be something that everyone is familiar with doing.

0 Likes

#9

Alas, I don’t know enough (yet) to know magic jiggery. Eventually.

0 Likes