All commands (14,187)

What's this?

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.

Share Your Commands


Check These Out

Make sure your script runs with a minimum Bash version
If you use new features of a certain Bash version in your shell script, make sure that it actually runs with the required version.

Convert clipboard HTML content to markdown (for github, trello, etc)
I always wanted to be able to copy formatted HTML, like from emails, on trello cards or READMEs... but the formatting is always wrong... But from this two links: * https://jeremywsherman.com/blog/2012/02/08/pasting-html-into-markdown/ * http://stackoverflow.com/questions/3261379/getting-html-source-or-rich-text-from-the-x-clipboard For instance, to to copy an formatted email to a trello card, just: 1. Select the email body 2. run: xclip -selection clipboard -o -t text/html | pandoc -f html -t markdown_github - | xclip -i -t text/plain 3. Paste in your trello card 4. Profit! 8-)

Look for English words in /dev/urandom
* to get the English dictionary: wget http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt

batch convert Nikon RAW (nef) images to JPG
converts RAW files from a Nikon DSLR to jpg for easy viewing etc. requires ufraw package

Simulate typing

Completely wipe all data on your Synology NAS and reinstall DSM. (BE CAREFUL)

Rename files in batch

vim multiple files at one time, split vertically.

Save xkcd to a pdf with captions
Saves to a PDF with title and alt text of comic. As asked for on http://bbs.archlinux.org/viewtopic.php?id=91100 Change xkcd.com to dynamic.xkcd.com/comics/random for a random comic.

Output a SSL certificate start or end date
A quick and simple way of outputting the start and end date of a certificate, you can simply use 'openssl x509 -in xxxxxx.crt -noout -enddate' to output the end date (ex. notAfter=Feb 01 11:30:32 2009 GMT) and with the date command you format the output to an ISO format. For the start date use the switch -startdate and for end date use -enddate.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: