News for hackers. Stuff that matters.
Re:My 10 UNIX Command Line Mistakes by sipefree on Sunday February 27, 2011 @11:01AM (#2268042)
With so many SSH accounts all over the place, I've started using color-coded prompts for all my connections:

http://i.imgur.com/KKQHj.png

This way I can be sure I'm typing `halt` into the right box, because it's easier to spot the wrong color than the wrong hostname in 10pt text.

Re:My 10 UNIX Command Line Mistakes by RK on Sunday February 27, 2011 @02:43PM (#2268701)
My lazy way to do something similar with Gnome Terminal is to make an "SSH profile" with a different background color. This helps reduce my mistakes.

Usually I'll just do things like df on the wrong machine and wonder what's going on with my disk space, but I've made a few less happy errors in the past.

Re:My 10 UNIX Command Line Mistakes by mdemare on Sunday February 27, 2011 @02:37PM (#2268682)
I change the background of my terminal when I ssh into another server, works great! (http://jeffmiller.github.com/2011/01/10/ssh-host-color)
Re:My 10 UNIX Command Line Mistakes by ohkine on Sunday February 27, 2011 @07:15PM (#2269419)
Unrelated to anything but: Your terminal colours seem a bit brighter than the standard ones in Snow Leopard. Are Terminal's colour capabilities improved in Lion, or are you using that SIMBL plug-in, or...?
Re:My 10 UNIX Command Line Mistakes by strmpnk on Sunday February 27, 2011 @08:13PM (#2269589)
That is indeed Lion running there. See the full screen icon on the top-right and smaller buttons on the top-left. I haven't played with it yet but there is much more control over colors in Terminal.app in 10.7.
Re:My 10 UNIX Command Line Mistakes by wglb on Sunday February 27, 2011 @11:10AM (#2268074)
Have you considered using 'screen' instead?
Re:My 10 UNIX Command Line Mistakes by barrkel on Sunday February 27, 2011 @11:22AM (#2268108)
I find a prompt better than a status line for reminding one of where one is, much like including the CWD in the prompt.

I use a similar style:

    [alfie] ~$
    [rupert] ~$
etc. for my SSH connections, but not for local shells, even though I also use screen. I also use color-coded prompts for selecting particular PATH and other environment variable setups for different branches of our corporate dev tree, to remind myself which compiler etc. I'm using.
Re:My 10 UNIX Command Line Mistakes by tres on Sunday February 27, 2011 @12:58PM (#2268360)
This is one of my strategies too (along with screen labels). Add to ~/.bash_profile :

PS1="\[\033[0m\](\[\033[0;36m\]\u\[\033[0m\]@\[\033[0;33m\]\h\[\033[0m\])(\[\033[1;34m\]\w\[\033[0;0;0m\])"

Re:My 10 UNIX Command Line Mistakes by sipefree on Sunday February 27, 2011 @11:18AM (#2268097)
I really don't see how these are connected. You could easily have one screen window open and type a command into it absent mindedly without realizing it's not your laptop's shell.
Re:My 10 UNIX Command Line Mistakes by tres on Sunday February 27, 2011 @12:34PM (#2268293)
If you're not using captions w/ screen, then you're not using screen.

Try adding to ~/.screenrc

caption always "| %L=%-Lw%45>%{+b by}%n%f* %t%{-}%+Lw%-0<"

Re:My 10 UNIX Command Line Mistakes by tres on Sunday February 27, 2011 @12:52PM (#2268345)
oh, and to change the name to the current machine, ctrl + a shift + a then name to whatever system you're connected to.