by brianwillis on 5/15/14, 5:25 AM with 235 comments
by cstross on 5/15/14, 8:28 AM
Basically it's a command-line front end to Apple's TextKit file import/export library. Works with a bunch of rich text/word processor formats, including OpenDoc, RTF, HTML 5, and MS Word. Critically, the HTML it emits is vastly better than the bloated crap that comes out of Microsoft Word or LibreOffice when you save as HTML ...
Install pandoc and multimarkdown as well and you've got the three pillars of a powerful, easy-to-use multiformat text processing system.
by eschaton on 5/15/14, 7:30 AM
by ggreer on 5/15/14, 8:22 AM
The Linux equivalent of `open` is `xdg-open`. I usually alias it to `op`, since `/bin/open` exists.
Another bit of terminal-sugar for OS X users:
alias lock='/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend'
And most Linux users: alias lock='gnome-screensaver-command -l'
If you find yourself accidentally triggering hot corners, the lock command is your savior.I've sorta-documented this stuff over the years, but only for my own memory. https://gist.github.com/ggreer/3251885 contains some of my notes for what I do with a clean install of OS X. Some of the utility links are dated, but fixing the animation times really improves my quality of life.
by greggman on 5/15/14, 7:57 AM
One tiny thing though, at the bottom it says
> Recall that OS X apps are not true executables, but actually special directories (bundles) with the extension .app. open is the only way to launch these programs from the command line.
Actually, you can launch them in other ways. Example
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/Users/<username>/temp/delmechrome --no-first-run
Will start a new instance of Chrome with it's own datastore in ~/temp/delmechrome. add some URL to the end to have it auto launch some webpage. Delete ~/temp/delmechrome to start over.by pling on 5/15/14, 7:38 AM
ssh-add -k keyfile
Integrates with keychain meaning you can have a passworded private key without having to play around with ssh-agent and shells and profiles. Put keychain access in the menu bar and you can lock the keychain on demand as well. Integration of ssh into the OSX workflow is absolutely awesome.That and some of the examples in that article really make it a killer platform for Unix bits.
by wink on 5/15/14, 11:55 AM
I wrote related rant once[0] when I tried to debug an issue of a misconfigured default browser.
by DCKing on 5/15/14, 1:17 PM
by nmc on 5/15/14, 7:33 AM
I like the way Fink [1] uses the /sw (software) directory.
Does anyone have a valuable opinion on the comparison between Fink and Homebrew — or maybe MacPorts?
by Monkeyget on 5/15/14, 9:05 AM
I've been investing some time in the command line on my Mac. I am moving from a dilettante going to the shell on a per-need basis to a more seasoned terminal native. It pays off handesomely! It's hard to convey how nice it to have to have a keyboard-based unified environment instead of a series of disjoined mouse-based GUI experiences.
Here are some recommendations pertaining to mastering the command line on a Mac specifically:
-You can make the terminal start instantaneously instead of it taking several seconds. Remove the .asl files in /private/var/log/asl/. Also remove the file /users/<username>/Library/Preferences/com.apple.terminal.plist
- Install iterm2. It possesses many fancy features but honestly I hardly ever use them. The main reason to use it instead of the default Terminal application is that It just works©.
-Make your terminal look gorgeous. It may sound superficial but it actually is important when you spend expanded period of time in the terminal. You go from this http://i.imgur.com/cx3zZL8.png to this http://i.imgur.com/MQbx8yK.png . You become eager to go to your terminal instead of reluctant. Pick a nice color scheme https://code.google.com/p/iterm2/wiki/ColorGallery . Use a nice font (Monaco, Source Code Pro, Inconsolata are popular). Make it anti aliased.
-Go fullscreen. Not so much for the real estate but for the mental switch. Fullscreen mode is a way to immerse yourself into your productive development world. No browser, no mail, no application notification. Only code.
-Install Alfred. It's the command line for the GUI/Apple part of your system. Since I installed it I stopped using the dock and Spotlight. Press ⌘+space then type what you want and it comes up. In just a few keystrokes you can open an application, open gmail/twitter/imdb/..., make a webs search, find a file (by name, by text content), open a directory,... It's difficult to describe how empowering it is to being able to go from 'I want to check something out in the directory x which is somewhere deep deep in my dev folders' to having it displayed in 2 seconds flat.
-Make a few symlinks from your home directory to the directories you use frequently. Instead of doing cd this/that/code/python/project/ you just do cd ~/project.
-Learn the shell. I recommend the (free) book The Linux Command Line: http://linuxcommand.org/tlcl.php . It guides you gently from simple directory navigation all the way up to shell scripting.
-Use tmux. Essential if you want to spend some time in the terminal. You can split the window in multiple independent panes. Your screen will have multiple terminals displayed simultaneously that you can edit independently. For example I'll have the code in one side and on the other side a REPL or a browser. You can also have multiple windows each with its own set of panes and switch from on to the other. With the multiple windows I can switch from one aspect of a project to another instantly. E.g: one window for the front-end dev, a second one for the backend and another for misc file management/git/whatever.
-Pick an editor and work towards mastery. I don't care if you choose vi or emacs. You'll be surprised how simple features can make a big change in how you type. You'll be even more surprised at how good it feels
The terminal is here to stay. It's a skill that bears a lot of fruits and that deprecate slowly. The more you sow the more you reap.
by runjake on 5/15/14, 3:51 PM
10. /System/Library/CoreServices/Applications/Wireless Diagnostics (with built-in wifi stumbler)
11. /System/Library/CoreServices/Screen Sharing.app (Built-in VNC client with hardware acceleration)
12. /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources (Command-line wifi configuration and monitoring tool)
Combine with sed, awk, and cut, and these tools can provide useful monitoring.
by torrent-of-ions on 5/15/14, 8:23 AM
by _jsn on 5/15/14, 7:30 AM
~$ mdfind tag:Active kind:xcode
/Users/jn/Code/xyz/xyz.xcodeproj
...
Queries like this also work in the Cmd-Space UI, or as a Saved Search. By default each term is joined with AND, but you can specify OR too.by smw on 5/15/14, 10:09 AM
$ mdf "*invoice*.pdf"
/Users/smw/Downloads/Invoice-0000006.pdf
https://gist.github.com/smw/a21a9f675ed3358830daby barbs on 5/15/14, 8:12 AM
For example, I set the letter 'o' as an alias for 'open' on OS X, and to "thunar" on Xubuntu and "nemo" on Linux Mint.
by milla88 on 5/15/14, 7:11 AM
Try this out: say hello -v Good
by pirateking on 5/15/14, 11:24 AM
Right now I am more interested in creating simple visual interfaces on top of UNIX-y tools, for my own personal use cases. The main benefit of this is the ability to better experiment with and optimize my workflows for different properties as needed through different combinations of single responsibility interfaces and single responsibility programs.
I am sensing that there is great promise in seeing much higher APMs (actions per minute) for many tasks, even compared to the all-powerful command line. Also, there are lots of interesting possibilities for better visual representations of data to improve comprehension and usability.
by ansimionescu on 5/15/14, 1:10 PM
* lunchy: wrapper over launchctl, written in Ruby – https://github.com/mperham/lunchy
* brew cask: "«To install, drag this icon...» no more", as they say – https://github.com/caskroom/homebrew-cask
* have fun with "say" – https://github.com/andreis/different
by allavia88 on 5/15/14, 7:15 AM
It seems like a large portion of HN is less experienced re sysadmin, but is interested in it nonetheless. Perhaps there's room to make a 'codecademy for unix' type course? Curious to see what folks thing.
by jpb0104 on 5/15/14, 2:42 PM
by archagon on 5/15/14, 7:24 AM
This is only tangentially related, but I recently wrote a little Automator Service to gather any selected file and folder paths from Finder. I very often need to grab the path of something for programming-related stuff, and doing it from the command line or with the mini-icon drag-and-drop takes way too long. Maybe somebody here will find it useful! http://cl.ly/1a3s3g1u2Q2w
by shurcooL on 5/16/14, 2:56 AM
function gocd {
cd `go list -f '{{.Dir}}' $1`
}
It uses the same syntax as go list to specify packages, so you can do, e.g.: ~ $ gocd .../markdownfmt
markdownfmt $ pwd
/Users/Dmitri/Dropbox/Work/2013/GoLand/src/github.com/shurcooL/markdownfmt
markdownfmt $ _
So nice.by hibbelig on 5/15/14, 8:31 AM
ssh somehost
cd /some/dir
grep -lr foo . | remote_pbcopy
I guess something like this is possible with GNU Screen or with Tmux, and perhaps the Tmux/iTerm interaction helps, but I've never figured it out.by js2 on 5/15/14, 1:05 PM
sips - https://developer.apple.com/library/Mac/documentation/Darwin...
osascript - https://developer.apple.com/library/mac/documentation/Darwin...
by RazerM on 5/15/14, 7:58 AM
open /Applications/Safari.app/
as an example, when open -a safari
does the same thing.by gotofritz on 5/15/14, 4:45 PM
by nicksergeant on 5/15/14, 7:23 PM
The original title is clearly more accurate / useful / canonical. The overwritten title is ambiguous. This is indeed not a list of every OS X command line utility.
by mmaldacker on 5/15/14, 7:28 AM
by vladharbuz on 5/15/14, 7:53 AM
"Select a window using your mouse, then capture its contents without the window’s drop shadow and copy the image to the clipboard:
$ screencapture -c W"
-c captures the cursor, W is not an option. The real command for this is: $ screencapture -C -o
by salgernon on 5/15/14, 4:10 PM
"cmd-a" "cmd-c" (copy all)
double click on a word I'm looking for, "cmd-e" to enter it into the find clipboard
'pbpaste | fgrep --color `pbpaste -pboard find`'
I have that aliased as 'pbg'.
by stretchwithme on 5/15/14, 5:51 PM
by fuzzywalrus on 5/15/14, 5:08 PM
Otherwise good article.
by chrismorgan on 5/15/14, 7:59 AM
by chrisBob on 5/15/14, 3:09 PM
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
I thought that was one of the most amazing things when I used a linux system, but OS X is black and white by default.
by nemasu on 5/15/14, 7:08 AM
by huskyr on 5/15/14, 7:19 AM
by RexRollman on 5/15/14, 10:17 PM
by guard-of-terra on 5/15/14, 9:25 AM
That alone might be sufficient reason to migrate from ubuntu.
by fmela on 5/15/14, 7:35 PM
by conradev on 5/15/14, 11:18 AM
It's super useful for keeping long running tasks running.
by cormullion on 5/15/14, 10:23 AM
by lastofus on 5/15/14, 8:20 AM
My co-workers and I used to ssh into the iMacs of non-technical users in our office and have a good laugh from a nearby room.
by hackeroni on 5/24/14, 1:56 AM