Live data from Hacker News

OS X Command Line Utilities

mitchchn.me

61–70 of 210 posts

Re: OS X Command Line Utilities

#61
post #39

Earlier quoted context omitted.

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.

You're in the minority then... My original comment has been downvoted quite a bit. It's strange to me that people think this is okay. If someone is willing to use that power for a prank, it seems to me more likely that they'll use it for... whatever.

I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.

Re: OS X Command Line Utilities

#62

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.

I prefer mlocate to locate, as it rebuilds the index in a flash by diffing and by paying attention to modification dates when traversing, so you can run its updatedb more frequently without a noticable penalty.

That said, mdfind is terrific -- it's index is, as you suggested, always upto date, and it doesn't just index file names, but also content.

Re: OS X Command Line Utilities

#63
post #61

Earlier quoted context omitted.

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.

You're in the minority then... My original comment has been downvoted quite a bit. It's strange to me that people think this is okay. If someone is willing to use that power for a prank, it seems to me more likely that they'll use it for... whatever. I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.

I don't agree with your logic and think you need a more nuanced sense of humor. Spying on someone remotely? Fireable offense. Remotely kicking off speech utils between people on a team once? Not so much.

Disclaimer: I have managed tech teams before. It is better to forgive then have knee jerk managerial reactions.

Re: OS X Command Line Utilities

#64
post #55

This is a great intro. Here's my favorite OS X Terminal trick: ⌘. (command period) is a hotkey not defined in the menu for sending BREAK. This is automatically equivalent to ctrl+c in shells, ctrl+g in emacs and ESC in Vim. Similarly, ⌘K is short for clearing the screen. These are much more ergonomic than the standards on Mac laptops and wireless keyboards.

For those not already aware, cmd &. is the standard shortcut for "stop". Works for all sorts, from web page loads to Xcode builds.

Re: OS X Command Line Utilities

#65
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.

Recommend "Amphetamine" as an alternative. More features and kept up to date with bug fixes and improvements. I am not affiliated, just a happy user.

Re: OS X Command Line Utilities

#66
post #55

This is a great intro. Here's my favorite OS X Terminal trick: ⌘. (command period) is a hotkey not defined in the menu for sending BREAK. This is automatically equivalent to ctrl+c in shells, ctrl+g in emacs and ESC in Vim. Similarly, ⌘K is short for clearing the screen. These are much more ergonomic than the standards on Mac laptops and wireless keyboards.

How is cmd + K different from cmd + R and/or $ clear?

Re: OS X Command Line Utilities

#67
post #61

Earlier quoted context omitted.

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.

You're in the minority then... My original comment has been downvoted quite a bit. It's strange to me that people think this is okay. If someone is willing to use that power for a prank, it seems to me more likely that they'll use it for... whatever. I like a good prank. Leave your screen unlocked? You deserve the abuse you get. :) But accessing my laptop in this way is just creepy.

...and jumping on someone's unlocked computer without authorization is different but OK? right...here's your sign

Re: OS X Command Line Utilities

#68

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…

For the few formulas that create an app bundle (Homebrew deliberately avoids GUIs in general), "brew linkapps" symbolically links the bundle to /Applications; similar to the way it links things from /usr/local/Cellar/$formula/$version/bin to /usr/local/bin.

Re: OS X Command Line Utilities

#69

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…

I thought that /usr/local was a widely accepted place on UNIX systems like OS X for user installation of UNIX applications and tools (which are usually command line utilities). /Applications on the other hand is where Mac-specific GUI apps are installed, right? You wouldn't clutter up /Applications with command line utilities like ffmpeg, ImageMagick, wget, youtube-dl, or sox, would you? Isn't this separation done by design?
Post reply on HN