Hacker News new | ask | show | jobs
by koenigdavidmj 3626 days ago
The last one of these that popped up on HN replaced a lot of the common UNIX commands, and a lot of people here rightly asked 'why would I run "mac tar:extract" when I could just run "tar xf"?'

This one seems to get the balance a lot more right, with a lot of things that the average OS X admin wouldn't know off the top of their head.

- 'm lock': That's a lot better than whichever arcane key combination does it by default (my laptop stays closed most of the time, so the power button isn't an option).

- 'm nosleep': I would have to look that one up.

- 'm finder showhiddenfiles': It beats Googling for the proper 'defaults write' invocation.

3 comments

The basic command for keeping the machine awake is `caffeinate`, and has a few other nice options like changing what kind of sleep is prevented (disk, display, system) and also waiting on a PID (looks like that was added in 10.10).

Related to that is `pmset -g assertions` which will list all the various things that are keeping your machine from sleeping.

strange, I always used `pmset noidle` instead of `caffeinate`. But seems it does the same. I somehow assumed `caffeinate` is the same as this app store thing called Caffeine.
Using `pmset noidle` is now deprecated in favor of `caffeinate` according to the pmset man page.
Good to know!
I think if you go to the Keychain, you can configure it to put an icon in the top right tray that you can click on to lock your computer. I often find myself accidentally moving my mouse to the top right corner of my Windows and Linux machines to lock them now.
That is exactly what I do. I think that the combo I would normally try (Cmd+L) logs you out. I remember at one point trying to find the correct key combination, and the primary results were to put the lock icon up. That works find enough for me.
Defining a hot corner in the bottom left in trackpad prefs has been my go to for years. It works fast and is rarely activated by accident.
My first impression was _gaah!_ just RTFM! But after calming down, I realized this is not significantly different from a command line version of TinkerTool. Not necessarily something I would use, but I could see an audience for it.