Live data from Hacker News

Unix Tricks

cfenollosa.com

151–160 of 166 posts

Re: Unix Tricks

#151

You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.

You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows.

I used to feel this way. Then one day I figured out how to enable this in Bash. Resulted in a confusing mess. Turns out you most likely want terminal sessions to be distinct until you end them.

Re: Unix Tricks

#152
Send a command to display 1.

`xterm -display :1 -e `

This is useful when running automated tests on top of vnc.

Re: Unix Tricks

#153
post #83
post #64

Missing trick: In bash, "ESC" then "." fetches the last parameter of the previous command. It's invaluable (same as typing "!$" but you get to see and edit it)

There are some great tips/tricks in this document. Too bad it's not in Markdown or something easier on the eyes!

Markdown-ified version: http://www.notehub.org/kywfm

Editing password is hackernews if anyone wants to tune up the markdown.

Re: Unix Tricks

#155

You know what I hate? My history isn't aggregated in real time across all my Mac OS X terminal windows. You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. Especially when I hit the up arrow to go back in my terminal history.

I prefer to keep mine separate, but I always use specific terminals / screen sessions for (mostly) the same type of work (admin, specific projects, web dev, etc.) so each have their own history, as well as keeping a per-directory record.

So far over 130000 command lines (with timestamp & cwd) for past 2.5 years, just on my laptop.

Re: Unix Tricks

#157
post #80

Earlier quoted context omitted.

> Typing in long commands in the Mac OS X terminal and then them wrapping weirdly. For all people who dont use Mac OS X: This happens because your PS1 is wrongly set and bash cant calculate correctly the length left of your line. Try it out, by going back to default with no colors and crap and see how long it goes. For mac os x users. The above wont help, dont even try it.

I found the solution to bash problems was to move to zsh. I did that almost 10 years ago and haven't regretted the decision.

I switched to zsh for a few hours once, but it broke TRAMP in Emacs. There is probably a work around...

Re: Unix Tricks

#158
post #141
post #133

Earlier quoted context omitted.

Also worth noting that native borne shell was always slightly slower than korn shell. Though been a long time since I checked that one out, though did on few systems and found it to be so. But there again csh was also about then, distant memory in for many that one. Also anything that will run script wise on bourne will run as is under korn. Though you may well find that it is historical, which one a user picks shell…

I think shell performance stopped mattering the moment I dumped my 50MHz SPARC LX for a Sun Ultra 2.

Very true, but in production, every nanosecond counts sometimes.
Post reply on HN