Live data from Hacker News

Badassify your terminal and shell

jilles.me

41–50 of 54 posts

Re: Badassify your terminal and shell

#41
post #18

I don't want my terminal badassified; I want to get work done. Rather than bling out my command prompt I simply try to do what real developer, data, and sysadmin badasses do: * Learn your shell language -- really learn it. Learn how to fit programs together, how to manage jobs, and all of the control structures in your shell language. Avail yourself of aliases and shell functions. * Learn the Unix command set, sed, a…

I've done all of the above, and I've blinged out my prompt. They're not mutually exclusive :)

Re: Badassify your terminal and shell

#42
post #18

I don't want my terminal badassified; I want to get work done. Rather than bling out my command prompt I simply try to do what real developer, data, and sysadmin badasses do: * Learn your shell language -- really learn it. Learn how to fit programs together, how to manage jobs, and all of the control structures in your shell language. Avail yourself of aliases and shell functions. * Learn the Unix command set, sed, a…

Agreed. I would add 'grep' in there as an absolute must have. The sed, grep, awk holy trinity will allow you to do pretty much any type of text manipulation and searching that you can imagine.

I have one more that I like. I call it 'rex' and it basically allows me to do a regex substitution on command line text (not stdin, but actual command line args). It mostly comes in handy when looping over files in a directory where I want to do some kind of processing based on information in the file name. For example, I can tag all of the episodes of a podcast with their track numbers (several podcasts I listen to don't do id3tags) with this command:

    for f in *.mp3; 
      do id3v2 -T `rex 's/^[^0-9]*([0-9]+).*\.mp3$/\1/` $f; 
    done
The script itself is really simple, but I can post the source if anybody's interested.

Re: Badassify your terminal and shell

#43

Earlier quoted context omitted.

Exactly ... Back to basics. Just learn how to use the terminal in its default form. We've been doing it for years efficiently.

Dude. Optimize for your 99% use case. I spend ten minutes a week on someone else's machine. Does that really make it a bad idea to remove warts and add niceties to my machine? Assuming you aren't literally a stump it should be easy enough to go back to the defaults.

I wonder if it says something about how brittle software and their interactions tend to be: many very experienced computer users tend to promote a certain minimalism. Not for minimalism's sake, but apparently because their computers are in such a delicate and brittle state that any superfluous may brake it, and they have to expend a lot of effort to get it back to that same state. And also the fact that they aren't able to customize whatever other machine they have to use for any considerable time, probably because the administrator won't let you tweak anything (again, because it might break/introduce vulnerabilities etc. Again, it's in a brittle state).

Re: Badassify your terminal and shell

#44
post #18

I don't want my terminal badassified; I want to get work done. Rather than bling out my command prompt I simply try to do what real developer, data, and sysadmin badasses do: * Learn your shell language -- really learn it. Learn how to fit programs together, how to manage jobs, and all of the control structures in your shell language. Avail yourself of aliases and shell functions. * Learn the Unix command set, sed, a…

Using the world's most common shell in a standard configuration comes with benefits, too. Incredible portability of your code & experience. Plus shells that try to be too smart or do too much always break, leaving you debugging your shell . Shoot me now.

"X's that try to be too smart or do too much always break, leaving you debugging your X" is, based on my observations, a true statement for values of X equal to ANY core system component: package manager, init system, build system, etc.

Re: Badassify your terminal and shell

#45
post #38
post #35

Earlier quoted context omitted.

Right, sure - but you definitely - well, probably ;) - still want iTerm2! For Linux, try terminator: http://gnometerminator.blogspot.co.uk/p/introduction.html , or your package manager. There are doubtless tons of other options.

Why do you definitely still want iTerm2? The only feature that I find even remotely compelling is mouse support, but so few programs handle mouse input that it largely doesn't matter. People always mention split panes, but I've never had a desire to vertically split my terminal window. If I ever did have such a desire, I'd probably just use tmux. And yes, iTerm2 claims to have some form of tmux integration, but I bel…

I use split panes all the time. Never got on with terminal multiplexers myself. Other stuff I like about iTerm2:

- configurable word boundaries for word selection by mouse

- X-style copy/paste (middle click to paste current selection)

- dabbrev-style word completion from current buffer, though I've not ended up finding this as useful as it seems it should be

But if you don't value any of this, then maybe you don't want it? Let me edit my post to fix this.

Re: Badassify your terminal and shell

#46
post #2

And what happens when you have to use the terminal on a machine that hasn't been "badassified"?

Things aren't as pretty, a lot of unnecessary 's are pressed, and you sometimes have to Google things other people may instinctively know. I don't mind the Googling so much -- if it's important enough, I'll eventually learn it.

Re: Badassify your terminal and shell

#47
post #18

I don't want my terminal badassified; I want to get work done. Rather than bling out my command prompt I simply try to do what real developer, data, and sysadmin badasses do: * Learn your shell language -- really learn it. Learn how to fit programs together, how to manage jobs, and all of the control structures in your shell language. Avail yourself of aliases and shell functions. * Learn the Unix command set, sed, a…

Agreed with everything you list here. I do think it's valuable to learn how to pretty-up and polish the shell prompt. I've set mine up to display the time as well as the exit status of the previous command, along with the usual tidbits of user, host, and cwd.

In terms of languages to learn, the most important is your shell, generally bash for most people. 99% of the time, bash is Fast Enough, even though it can often be very slow. Bash is incredibly ugly, but using its features and the userland tools that are standard on most Unices, you can do a lot of amazing things relatively easily.

For speedy programs, Perl can't be beat. For text manipulation, even C programs sometimes run slower than Perl and generally require more code and are much harder to maintain. Perl is nearly as ugly as Bash and has even more annoyances, but for raw text-processing throughput there's no competition.

Re: Badassify your terminal and shell

#48
I'm actually not convinced by kitchen-sink approaches like oh-my-zsh. It has so much stuff in it... where do you even begin (except for passive discoverability stuff like completion -- that's always good to have).

I would be more tempted by adding a few things at a time, piece-wise. Plundering oh-my-zsh could be an approach: add some parts, see if they're useful, if they fit in your workflow, else ruthlessly discard them.

Re: Badassify your terminal and shell

#49
post #45
post #38

Earlier quoted context omitted.

Why do you definitely still want iTerm2? The only feature that I find even remotely compelling is mouse support, but so few programs handle mouse input that it largely doesn't matter. People always mention split panes, but I've never had a desire to vertically split my terminal window. If I ever did have such a desire, I'd probably just use tmux. And yes, iTerm2 claims to have some form of tmux integration, but I bel…

I use split panes all the time. Never got on with terminal multiplexers myself. Other stuff I like about iTerm2: - configurable word boundaries for word selection by mouse - X-style copy/paste (middle click to paste current selection) - dabbrev-style word completion from current buffer, though I've not ended up finding this as useful as it seems it should be But if you don't value any of this, then maybe you don't wa…

Thanks for the response. But yeah, none of that sounds like things I'd want. Especially X-style copy/paste, I'm really glad Terminal.app doesn't do that (although interestingly, middle-click actually does paste the OS clipboard, but there's no auto-copy of selected text).

Re: Badassify your terminal and shell

#50
post #38

Earlier quoted context omitted.

Why do you definitely still want iTerm2? The only feature that I find even remotely compelling is mouse support, but so few programs handle mouse input that it largely doesn't matter. People always mention split panes, but I've never had a desire to vertically split my terminal window. If I ever did have such a desire, I'd probably just use tmux. And yes, iTerm2 claims to have some form of tmux integration, but I bel…

I've tried using iTerm2's tmux support and found it to actually be less friendly than just using tmux directly. Definitely a YMMV thing, I suppose, but I was seriously baffled. One thing I heard from several people in a previous discussion is that iTerm2 makes a thin outline around the terminal window and since they often have overlapping terminal windows (that are presumably opaque with black backgrounds), Terminal…

Huh, I never noticed the very thin outline around Terminal windows in Yosemite. Neat. I've been using a slightly-transparent dark background with blur for years (which gets slightly more transparent for background windows). That always made it really easy to visually distinguish overlapping windows. But I can see the border being useful for people who have completely opaque windows (with black backgrounds).
Post reply on HN