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:
Finds all directories containing more than 99MB of files, and prints them in human readable format. The directories sizes do not include their subdirectories, so it is very useful for finding any single directory with a lot of large files.
This command will display all lines between 2 patterns: word-a and word-b
useful for grepping command outputs from file
Finds the string in every file in an entire directory and all its subdirectories and replaces it with a new string. Especially useful when changing a machine's IP address or hostname - run it on /etc.
Probably only works with GNU du and modern perls.
The Linux /dev/full file simulates a "disk full" condition, and can be used to verify how a program handles this situation.
In particular, several programming language implementations do not print error diagnostics (nor exit with error status) when I/O errors like this occur, unless the programmer has taken additional steps. That is, simple code in these languages does not fail safely. In addition to Perl, C, C++, Tcl, and Lua (for some functions) also appear not to fail safely.
MIME::Base64 is a part of Perl5 distribution. You can also use decode_base64 for oposite result.
self explanatory see sample output
Insert a comma where necessary when counting large numbers. I needed to separate huge amounts of packets and after 12+ hours of looking in a terminal, I wanted it in readable form.
Adds a newline to the end of all cpp files in the directory to avoid warnings from gcc compiler.
That "^M" is Ctrl-M, which is a carriage return, and is not needed in Unix file systems.
Where ^V is actually Ctrl-V and ^M is actually Ctrl-M (you must type these yourself, don't just copy and paste this command). ^V will not be displayed on your screen.
Find all files that contain string XXX in them, change the string from XXX to YYY, make a backup copy of the file and save a list of files changed in /tmp/fileschanged.
This removes the type prefix used in Hungarian notation (v. bad) for PHP variables. Eg. variables of the form $intDays, $fltPrice, $arrItems, $objLogger convert to $days, $price, $Items, $logger.
Quick command to check if Perl library is installed on your server.
joins multiple lines to create single line with comma separated values. for example if we have an email addresses one per line (copy&paste from spreadsheet) it will oputput one line with comman separated addresses to put it to email client.