This Perl one-liner is intended to print the 10 most frequent client IP addresses in an Apache log file. It can easily be recycled to count anything, though.
read this entry »
The script command is a must for any unix sysadmin.
Once invoked, it will faithfully write anything you typed as well as any output generated in your terminal into a file of your choice (defaults to “typescript”).
This is great when you want to document everything you did on a specific server, for example.
Script started, file is typescript
When launched, you don’t see anything, but everything displayed goes to a file as well as the terminal.
As usual see the man page for details (like appending instead of creating a new file, launching another command instead of your default shell, and so on)
If you want to know on which CD is a package, without :
Then you can :
which will output the .virtual_packagetoc_N where N is the number of the CD holding that package.
1 2 3 4 5
# pwd /mnt/Solaris_10/Product # grep -l SUNWzsh .virtual_packagetoc_* .virtual_packagetoc_5 #
So SUNWzsh, the package for ZSH shell, is on CD #5 of Solaris 10 distribution (damn, I don’t have it !)
This tip is courtesy of BlaF (thanks dude !)