I'm both a one-liner fan and a haskell learner
Colorify colors input by converting the text to a number and then performing modulo 7 on it. This resulting number is used as the color escape code. This can be used to color the results of commands with complex outputs (like "482279054165371") so if any of the digits change, there's a good chance the color will change too. I say good chance because there's only 7 unique colors here, so assuming you were watching random numbers, there would be a 6/7 chance that the color would change when the number changed. This should really only be used to help quickly identify when things change, but should not be the only thing relied upon to positively assert that an output has not changed. Show Sample Output
move filename/rename filenames with Uppercase to lowercase in current directory Show Sample Output
Grabs the cmdline used to execute the process, and the environment that the process is being run under. This is much different than the 'env' command, which only lists the environment for the shell. This is very useful (to me at least) to debug various processes on my server. For example, this lets me see the environment that my apache, mysqld, bind, and other server processes have.
Here's a function I use:
aa_ps_all () { ( cd /proc && command ps -A -opid= | xargs -I'{}' sh -c 'test $PPID -ne {}&&test -r {}/cmdline&&echo -e "\n[{}]"&&tr -s "\000" " "<{}/cmdline&&echo&&tr -s "\000\033" "\nE"<{}/environ|sort&&cat {}/limits' ); }
From my .bash_profile at http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
Show Sample Output
easier way to recursively change files to lowercase using rename instead
Same as previous but compatible with BSD/IPSO
just deletes to rogue CR from dos files, and tr is always available.
Print the IP address and the Mac address in the same line Show Sample Output
This is a slightly modified version of the knoppix5 user oneliner (https://www.commandlinefu.com/commands/view/24571/draw-line-separator). Show Sample Output
Helpful when we want to do mass file renaming(especially mp3s). Show Sample Output
Save the script as: sort_file Usage: sort_file < sort_me.csv > out_file.csv This script was originally posted by Admiral Beotch in LinuxQuestions.org on the Linux-Software forum. I modified this script to make it more portable. Show Sample Output
This is a minimalistic version of the ubiquitious Google definition screen scraper. This version was designed not only to run fast, but to work using BusyBox. BusyBox is a collection of basic Unix tools that have been compiled into a single binary to save space on tiny installations of Unix. For example, although my phone doesn't have perl or the GNU utilities, it does have BusyBox's stripped down versions of wget, tr, and sed. It turns out that those tools suffice for many tasks. Known Bugs: This script does not handle HTML entities at all. I don't think there's an easy way to do that within BusyBox, but I'd love to see it if someone could do it. Also, this script can only define a single word, not phrases. (Well, you could if you typed in %20, but that'd be gross.) Lastly, this script does not show the URL where definitions were found. Given the randomness of the Net, that last bit of information is often key. Show Sample Output
Gives the same results as the command by putnamhill using nine less characters.
So I use OSX and don't have the shuf command. This is what I could come up with. This command assumes /usr/share/dict/words does not surpass 137,817,948 lines and line selection is NOT uniformly random. Show Sample Output
Expand a URL, aka do a head request, and get the URL. Copy this value to clipboard.
Take a file and ,."()?!;: give a list of all the words in order of increasing length. First of all use tr to map all alphabetic characters to lower case and also strip out any puntuation. A-Z become a-z ,."()?!;: all become \n (newline) I've ignored - (hyphen) and ' (apostrophe) because they occur in words. Next use bash to print the length ${#w} and the word Finally sort the list numerically (sort -n) and remove any duplicates (sort -u). Note: sort -nu performs strangely on this list. It outputs one word per length. Show Sample Output
Handles spaces in file names and directories. Optionally change directories as well by pipe to tr from dirname.
Translates first set into second set Show Sample Output
Convert long list of ' ' to a single space. Compress space and other characters. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: