commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
list top committers (and number of their commits) of svn repository.
in this example it counts revisions of current directory.
Your version works fine except for someone who's interested in commands 'sudo' was prefixed to
i.e. in your command, use of sudo appears as number of times sudo was used.
Slight variation in my command peeks into what commands sudo was used for and counts the command
Gives the same results as the command by putnamhill using nine less characters.
This command is primarily going to work on linux boxes.
and needs to be changed, for example
Displays a connection histogram of active tcp connections. Works even better under an alias. Thanks @Areis1 for sharing this one.
Revised approach to and3k's version, using pipes and read rather than command substitution. This does not require fiddling with IFS when paths have whitespace, and does not risk hitting command-line size limits.
It's less verbose on the missing files, but it stops iterating at the first file that's missing, so it should be definitely faster.
I expanded all the qlist options to be more self-describing.
print members both in file1 and file2
Counts TCP states from Netstat and displays in an ordered list.
The cut should match the relevant timestamp part of the logfile, the uniq will count the number of occurrences during this time interval.
Change the cut range for hits per 10 sec, minute and so on... Grep can be used to filter on url or source IP.
awk is evil!
I created this command to give me a quick overview of how many file types a directory, and all its subdirectories, contains. It works based off file extension, rather than file(1)'s magic output, because it ended up being more accurate and less confusing.
Files that don't have an ext (README) are generally not important for me to want to count, but you're free to customize this fit your needs.
This searches the Apache error_log for each of the 5 most significant Apache error levels, if any are found the date is then cut from the output in order to sort then print the most common occurrence of each error.
This command will return a full list of Error 404 pages in the given access log. The following variables have been given to awk
Hostname ($2), ERROR Code ($9), Missing Item ($7), Referrer ($11)
You can then send this into a file (>> /path/to/file), which you can open with OpenOffice as a CSV