Hacker News new | ask | show | jobs
by nmrm 4445 days ago
Bottom-line: "history -c" should never be interpreted as "covering your tracks". No one should be treating .history as a log file!

* First and most importantly, if you want a true log of history this can and should be achieved using a different mechanism (not effected by history -c).

* There exist bad CLI's which require entering the password on the command line. See the conversation below -- it took six posts on HN before the correct solution (make sure certain env vars are set to the right values) came out. So, hardly common knowledge.

- In fact, you space trick doesn't always work. Can I fire you for negligence if someone finds your .history since everyone should obviously know everything about bash history?

* If you run "man history", the very first thing you see is the -c option. Therefore, if you want to clear a password from your history file, this is mostly likely how you'll do it. You're effectively attributing criminal intent to anyone who's not sufficiently unix savvy.

* If you're treating .history is a log file, then you're being pretty damn close to criminally negligent with your logging practices (equivalent of providing an editor for apache's access.log on your homepage).

* Bash history files are not backed up, except perhaps accidentally with the rest of ~.

* History files rotate out after X commands. There is no way of guaranteeing that temporally-defined backup policies snapshot ~ before X commands are run.

Bash history is a "log file" in the same sense as the stack used for Word's "undo" mechanism is a "log file".