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:
Convert all .weblock files (Apple url) to a url on the stdout.
Btrfs reports the inode numbers of files with failed checksums. Use `find` to lookup the file names of those inodes.
List the busiest scripts/files running on a cPanel server with domain showing (column $12).
IP addresses and number of connections connected to port 80.
Easiest way to obtain the busiest website list (sorted by number of process running).
Sort netflow packet capture by unique connections excluding source port.
on some distro's you have to replace "BogoMIPS" with "bogomips".
Remove duplicate line in a text file.
displays a list of all file extensions in current directory and how many files there are of each type of extension in ascending order (case insensitive)
* Find all file sizes and file names from the current directory down (replace "." with a target directory as needed).
* sort the file sizes in numeric order
* List only the duplicated file sizes
* drop the file sizes so there are simply a list of files (retain order)
* calculate md5sums on all of the files
* replace the first instance of two spaces (md5sum output) with a \0
* drop the unique md5sums so only duplicate files remain listed
* Use AWK to aggregate identical files on one line.
* Remove the blank line from the beginning (This was done more efficiently by putting another "IF" into the AWK command, but then the whole line exceeded the 255 char limit).
>>>> Each output line contains the md5sum and then all of the files that have that identical md5sum. All fields are \0 delimited. All records are \n delimited.
When trying to find an error in a hosted project it's interesting to find out how the source is organized: Are there .inc files? Or .php files only? Or .xml files that probably contain translated texts?
Analyze an Apache access log for the time period with most activity and display the hit count, requesting IP and the timestamp. May help detect a brute force dos attack.
cut can handle files as well. No neet for a cat.
Same as the rest, but handle IPv6 short IPs. Also, sort in the order that you're probably looking for.
The first sort is necessary for ips in a list to be actually unique.
Show's per IP of how many requests they did to the Apache webserver
dumpfile is a CSV file, which its 1st field is a phone number in format CC+10 digits
Empty lines are deleted, before the output in format "prefix,ocurrences"
Counts of messages by recipient, with frozen messages excluded.