On Wed, Jan 31, 2007 at 10:18:18AM +0000, Alex wrote:
> >
> >We also learn that su and sudo hide the interesting part of the command.
> > Can someone who is clever at awk change the script
> > history | awk '{print$2}' | sort | uniq -c | sort -rg | head -n
> >to pick out the second word if the first is either 'su' or 'sudo' (or a
> >Bash-style 'ENVVAR=value' prefix)?
>
>
> I'd be willing to bet that the majority of the commands accessed through
> sudo on this list would be 'apt-get'. Am I wrong? :)
>
alan@wopr:~$ history | awk '$2 ~ /^(sudo|[^[:blank:]]+=)/{print $2 " " $3;next}{print
> $2}' | sort | uniq -c | sort -rg | head -n 10
43 sudo apt-get
3 LD_LIBRARY_PATH=. ./VirtualBox
2 sudo powernowd
2 sudo modprobe
2 sudo make
2 sudo ls
2 sudo kill
2 sudo chmod
2 sudo apt-mirror
2 LD_LIBRARY_PATH=. ./VBoxSVC&
Nope :)
Cheers,
Al.