News for hackers. Stuff that matters.
Re:Your top 100 unix commands, for science by JOnAgain on Sunday May 19, 2013 @01:23PM (#5733586)
You probably want

`history -100`

on OS X, anyway, the default only gives 15 or so commands in history

Re:Your top 100 unix commands, for science by nwh on Sunday May 19, 2013 @02:18PM (#5733827)
On 10.8, I'm getting the full 500 lines of history. Not sure that the behaviour has ever been different.
Re:Your top 100 unix commands, for science by McUsr on Sunday May 19, 2013 @02:29PM (#5733885)
I believe I have set HISTFILESIZE TO 2000 or something, I still need to compact it, and have commands like ls pruned by HISTIGNORE.

I use the awkscript below to compact it:

# histsort.awk --- compact a shell history file # Thanks to Byron Rakitzis for the general idea

     {
         if (data[$0]++ == 0)
             lines[++count] = $0
     }
     
     END {
         for (i = 1; i <= count; i++)
             print lines[i]
     }
Re:Your top 100 unix commands, for science by hackerpants on Sunday May 19, 2013 @01:28PM (#5733612)
Huh, I didn't know that. What command gives the entire history on OS X, then?
Re:Your top 100 unix commands, for science by RKearney on Sunday May 19, 2013 @01:44PM (#5733678)
history shows the full .bash_history, but by default HISTFILESIZE is 500 so it only stores 500 entries.
Re:Your top 100 unix commands, for science by RBerenguel on Sunday May 19, 2013 @01:42PM (#5733666)
I ran this in Mac OS without a hitch, gave 100. I use zsh, maybe the default shell doesn't?