Live data from Hacker News

OS X Command Line Utilities

mitchchn.me

91–100 of 243 posts

Re: OS X Command Line Utilities

#91

This was supposed to be few lines of remarks. It expanded quickly in relation with my enthusiasm for this topic. 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 disjoine…

> - Install iterm2. The main reason to use it >instead of the default Terminal application is that It just works©. What's wrong with the default Terminal application? I use it daily and have been for close to a decade. I never found myself wishing it did anything than what it already does. > -Use tmux. Meh. For most people screen works just as well. Perhaps more importantly, you can rely on screen being available pre…

iTerm2 does vertical and horizontal splitting better than Terminal.app.

tmux does vertical and horizontal splitting better than screen.

That's my rationale for using iTerm2 and tmux instead of Terminal.app and screen.

(yes, I'm aware that screen has improved its splitting recently, but I switched to tmux in 2011, after seeing a presentation about it by Nicholas Marriott)

Re: OS X Command Line Utilities

#92
post #87

This was supposed to be few lines of remarks. It expanded quickly in relation with my enthusiasm for this topic. 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 disjoine…

Another trick I learned from an older HN comment is to create a .marks directory in your home directory and then add the following to your .zshrc export MARKPATH=$HOME/.marks function jump { cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1" } function mark { mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1 } function unmark { rm -if "$MARKPATH/$1" } function marks { ls -l $MARKPATH | sed 's/ / /g' | cut -d' ' -f…

You can use hop to similar end, and it's got support for shortest unique name and tab completion. https://github.com/Cue/hop

Re: OS X Command Line Utilities

#93
'open' is on of the things I long for most as a Linux user. There are several ways to achieve something that are all inferior or downright broken. Usually you don't have a huge problem, until you have. xdg-open for example could've solved this, if it was universally working.

I wrote related rant once[0] when I tried to debug an issue of a misconfigured default browser.

[0]: http://f5n.org/blog/2013/default-browser-linux/

Re: OS X Command Line Utilities

#94
post #44
post #32

Earlier quoted context omitted.

'cd -' is implemented by the cd command using the OLDPWD environment variable. It works in all shells.

I did some digging and it turns out I had autopushd set. No wonder I didn't understand the usefulness of pushd/popd; I was already using them. Also, by "cd -" I meant cd -[tab], cd -1, cd -2, etc.

Thanks! didnt know the tab feature.

Re: OS X Command Line Utilities

#95
post #91

Earlier quoted context omitted.

> - Install iterm2. The main reason to use it >instead of the default Terminal application is that It just works©. What's wrong with the default Terminal application? I use it daily and have been for close to a decade. I never found myself wishing it did anything than what it already does. > -Use tmux. Meh. For most people screen works just as well. Perhaps more importantly, you can rely on screen being available pre…

iTerm2 does vertical and horizontal splitting better than Terminal.app. tmux does vertical and horizontal splitting better than screen. That's my rationale for using iTerm2 and tmux instead of Terminal.app and screen. (yes, I'm aware that screen has improved its splitting recently, but I switched to tmux in 2011, after seeing a presentation about it by Nicholas Marriott)

Why split your terminal if you have screen / tmux?

Re: OS X Command Line Utilities

#96

This was supposed to be few lines of remarks. It expanded quickly in relation with my enthusiasm for this topic. 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 disjoine…

I wholeheartedly agree that it's a good investment to spend time learning your way around the shell. And I've been quite successfully proselytizing it at home: the terminal and the UNIX toolset has been part of my sons' introduction to computing. I actually wrote it down in form of a (free, online) book. It began with my sons in mind, but it soon became a more serious endeavor:

http://juanreyero.com/hacker-ways/index.html

HN is not the target audience, but it might be helpful for somebody.

Re: OS X Command Line Utilities

#97
post #85

Earlier quoted context omitted.

> - Install iterm2. The main reason to use it >instead of the default Terminal application is that It just works©. What's wrong with the default Terminal application? I use it daily and have been for close to a decade. I never found myself wishing it did anything than what it already does. > -Use tmux. Meh. For most people screen works just as well. Perhaps more importantly, you can rely on screen being available pre…

I encountered some problems with command-line emacs control sequences not being captured correctly, though the last time I tried was a while ago.

iirc Terminal has some preferences for properly handling special keys like Ctrl and meta. Does that help our was your problem something different?

Re: OS X Command Line Utilities

#98
post #25

It seems odd to have open /Applications/Safari.app/ as an example, when open -a safari does the same thing.

It's hard to beat cmd+space safari

Agree, but it's actually more like:

    cmd+space sa 
For most people. Because it seems to prioritise based on frequency of past selection.

Re: OS X Command Line Utilities

#99
post #93

'open' is on of the things I long for most as a Linux user. There are several ways to achieve something that are all inferior or downright broken. Usually you don't have a huge problem, until you have. xdg-open for example could've solved this, if it was universally working. I wrote related rant once[0] when I tried to debug an issue of a misconfigured default browser. [0]: http://f5n.org/blog/2013/default-browser-li…

xdg-open works for me with the GNOME-configured default application.
Post reply on HN