Hacker News new | past | comments | ask | show | jobs | submit login

This guy is the inverse of me, because I have linked my .bash_history to /dev/null



Semi-serious question: do you delete all your emails after you've read them too?


No, emails are important.

I also don't run a keylogger.


haha (semi-serious laugh)


You could just disable it instead, saves some cpu cycles.


Assuming I am the average Gentoo user, how many CPU hours would I save in a year? I doubt it is worth the time investment.


I'll do this.


I find that facination, care to expand on your reasons?

I assume you have the in-memory history enabled, but still


Why?


Why not? I mean, what's the value of knowing you typed 'ls -l' or 'ps -augx' on December 12th, 2012?


The value is in when you remember you did something before, but not exactly how. So you just grep or scan through your history, and the files you edited / commands you ran are likely to refresh your memory even if they don't exactly capture the entire workflow.

Also means you don't have to retype complicated commands too often.

Practical example: I remember I cleaned up some calibre converted epubs with perl a couple months ago, because they had a piece of text injected by some kind of generator on every page. It took me some time to figure out the exact replacement patterns, and if I were to do it again, I just need to do:

$ history 0 | grep perl ... 823 perl -0777 -i.original -pe 's#<b class="calibre1">Generated by ABC Amber LIT Conv<a href="http://www.processtext.com/abclit.html" class="calibre2">erter, http://www.processtext.com/abclit.html</a></b></p>\n<p class="calibre3">##g' part1.xhtml 825 perl -0777 -i.original -pe 's#<b class="calibre1">Generated by ABC Amber LIT Conv<a href="http://www.processtext.com/abclit.html" class="calibre2">erter, http://www.processtext.com/abclit.html</a></b></p>\n<p class="calibre3">##g' *.xhtml ...

Then inspect the history around those commands to find exactly how I got to that point.


It's moreso for when you spend time crafting the perfect command, and dont' want to repeat yourlself. Example..

find . -type d -print0 | sort -z | xargs --null -I '{}' du -sh '{}' | sort -h

Simple and clear; but history gives you the convenience to do find<C-R><CR> and having the command run with out parameter/typo verification.


To be fair, if you've built the "perfect" command, it would serve you better to put it in a alias or shell script. That way it will move with you.


It's more the value of "what command and which options did I run 8 months ago to convert data from format x to format y".

You can filter things like ls and ps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: