Slashdot stories can be listened to in audio form via an RSS feed, as read by our own robotic overlord.

 



Forgot your password?
typodupeerror

Comment: Re:Show attached block devices (Score 1) 2362

by indigoid (#25654901) Attached to: (Useful) Stupid Unix Tricks?

oops. the squeaky wheel gets the oil, I guess. :-( thanks!

I do wish bash history had (at least optional) timestamps stored in it for each command. No good for mandatory auditing (users can always modify their histories to hide nastiness) but useful for comparing against other logfiles when troubleshooting stuff.

Comment: Re:Show attached block devices (Score 1) 2362

by indigoid (#25651587) Attached to: (Useful) Stupid Unix Tricks?

I have this in $HOME/.bashrc:

if test "$PS1" ; then
                HISTDIR=${HOME}/.history
                HISTFILE=${HISTDIR}/$(/bin/echo ${LOGNAME}-$(/usr/bin/tty)-$(/bin/date -Iseconds)
                unset HISTSIZE HISTIGNORE HISTCONTROL HISTFILESIZE
                touch $HISTFILE
fi

It has the somewhat unfortunate downside of starting every shell with no history, but on the flipside it keeps a history of every interactive bash session you have, ever, ever. A must on production systems, IMHO. Upon reflection though I cannot figure out why the hell I put the 'echo' command there. Strange. I last touched that file in 2006. If you have NFS-mounted $HOME (which I don't) you could ad the hostname into the history filename too and keep a central log of everything you do on all such machines.

$ find ~/.history -type f | wc -l
      4790

"Love is a snowmobile racing across the tundra and then suddenly it flips over, pinning you underneath. At night, the ice weasels come." --Matt Groening

Working...