Live data from Hacker News

OS X Command Line Utilities

mitchchn.me

41–50 of 210 posts

Re: OS X Command Line Utilities

#41

Great list, some really useful commands. One question: What's wrong with "locate"? It is really fast because the file system contents are indexed. As long as you understand that it's not going to pick up the latest new files without running "updatedb" (sudo/usr/libexec/locate.updatedb" in os x) first, it's much better than find if you're doing a quick search. However, I didn't know spotlight has a CLI. Cool.

Given spotlight is getting more and more broken, I'd say give "locate" a try.

Re: OS X Command Line Utilities

#44
post #18

I would add caffeinate, which prevents the Mac from going to sleep. It can do this indefinitely, for a fixed period of time, or after a process is done running. You can even specify that process either as the PID of an existing process or by invoking it through caffeinate itself.

https://itunes.apple.com/us/app/caffeine/id411246225?mt=12 I use this all the time, it's the GUI version presumably.

It uses the same underlying API. I use it too. It’s only on–off, though, so you have to remember to turn it off.

Re: OS X Command Line Utilities

#45
post #39
post #26

Earlier quoted context omitted.

I must say...being a sysadmin with the ability to ssh into developers' laptops remotely in our domain...this is one of the more fun commands ;)

I hope that ssh'ing into anyone's laptop using your sysadmin credentials in order to play a prank is a fireable offense at your company.

Agree. Though until people never mess up their computers, we'll always need root. All super user interactions should be logged and audited, always. Not just "this was logged..." Which most people know means no one will ever look at it. But if everyone knew that was backed up with a call as to why that interaction happened with no associated case, etc.

Re: OS X Command Line Utilities

#46

I have fond memories of discovering my college roommate's open SSH connection, and using "say" to great effect.

Back in the day you'd "telnet" into your friend's "Sun workstation" and cat an "aiff" to the "/dev/audio". How times have changed! :-)

Re: OS X Command Line Utilities

#47
This was posted last year and did very well on HN [1]. I remember because it is literally the thing that got me interested in using the command-line as a power user...I'm embarrassed to say I hadn't really understood piping, but curling texts from Gutenberg into `say` was a fun introduction. Now I constantly use open, pbpaste, and pbcopy... learning about screencapture was also extremely helpful for my blogging and tutorial writing, as I've written a few wrappers around it to customize and optimize its output, including auto-uploading it and creating a snippet I can quickly paste into a blog post.

Great list!

[1] https://news.ycombinator.com/item?id=7747982

Re: OS X Command Line Utilities

#48
post #25

I like do harmless pranks on coworkers who don't lock their computers yes "lock your computer, numbskull" | xargs say Just repeats the phrase in a monotone computer voice over their headphones. I only do this to engineers, tried it on a PM once, never again.

Have you ever asked yourself if maybe you're just being annoying? I don't lock my computer. It'll time out and lock after an hour but I prefer to leave it unlocked.

Then why have it lock at all? You must never have access to critical things like a bank account, source code, internal documentation of business ongoings. So basically if you have no sensitive information, by all means!

Re: OS X Command Line Utilities

#49
post #39
post #26

Earlier quoted context omitted.

I must say...being a sysadmin with the ability to ssh into developers' laptops remotely in our domain...this is one of the more fun commands ;)

I hope that ssh'ing into anyone's laptop using your sysadmin credentials in order to play a prank is a fireable offense at your company.

And I hope that I would get fired for a little rare, light-hearted humor as I wouldn't want to work there anyways. Chill out, winston.

Re: OS X Command Line Utilities

#50

As a longtime Mac user (as early as System 7) and aficionado of UNIX, I love OS X's CLI and its affordances. The linked article provides several well-packaged tidbits that might encourage users of other CLI-replete OS's to check out OS X. More power. However, I'm not a fan of the soft recommendation for Homebrew. I understand Homebrew places everything in `/usr/local` but software installs on Mac should generally con…

The /applications folder is for .app bundles; Homebrew mostly installs Unix binaries which are appropriately placed in /usr/local , just like many Apple-supplied binaries are in /usr. The two conventions work well side-by-side. The vast majority of Homebrew packages are not available as .dmg or .pkg ; installing that way also is a huge PITA when dealing with a myriad of small developer tools that require dependencies…

Though, wouldn't it be better if all software on Mac used the native package manner? Obviously in an ideal world...
Post reply on HN