Given a file with the format of 'git log --pretty=short', search in last 100 commits for one with the same description. I used this when after a rebase I had to find out the new commit ids. The second sed replaces all special characters with dots so they don't mess up the grep later on. Show Sample Output
A lot of files in one dir is not so cool for filesystem.
Simply add this to whatever apache startup script you have, or if you are on a MAC, create a new automator application. This will show a pretty growl notification whenever theres a new Apache error log entry. Useful for local development
make a bunch of files with the same permissions, owner, group, and content as a template file (handy if you have much to do w. .php, .html files or alike)
This exports all lines of input file as environment variables, assuming each line is like these: OH=YEAH FU=UUUU
git gc should be run on all git repositories every 100 commits. This will help do do so if you have many git repositories ;-)
This will strip out the relivent disk information from kvm. I'm using it to find disks on a SAN which are no longer in use. Show Sample Output
This command is used to verify a sha256sum-formatted file hash list on IBM AIX or any other UNIX-like OS that has openssl but doesn't have sha256sum by default. Steps: 1: Save to the filesystem a script that: A: Receives as arguments the two parts of one line of a sha256sum listing B: Feeds a file into openssl on SHA256 standard input hash calculation mode, and saves the result C: Compares the calculated hash against the one received as argument D: Outputs the result in a sha256sum-like format 2: Make the script runnable 3: Feed the sha256sum listing to xargs, running the aforementioned script and passing 2 arguments at a time Show Sample Output
Find's all png's in the current folder and all of its children pngcrushes all results. Destructive.
Lost your luks passphrase? You can always bruteforce from the command line. See the sample output, a simple command using a dictionary. Show Sample Output
Sometimes I get FLAC files that RhythmBox can't play but VLC can. So I re-encode them using GStreamer at highest compression.
Replace "APIKEY" with your public apikey Show Sample Output
Usage:
command | hl 'regex'
This command takes all `.po` files inside `i18n` directory and compiles them to `.mo` files with same basename
rename all dirs with "?" char in name, leave spaces and () in place Show Sample Output
Given a list of filenames, one per line, in /tmp/filelist, calculate the total sum disk usage.
This helps me determine which repo I want to use for downloading ISO files 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: