Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.
Hide

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:

Hide

News

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Commands by hendry from sorted by
Terminal - Commands by hendry - 12 results
aws cloudfront list-distributions | jq -r '.DistributionList | .Items | .[] | .Id + " " + .Aliases.Items[]'
2016-09-19 06:36:59
User: hendry
Tags: aws jq awscli
0

Looking up the id of a CF domain can be painful. Not anymore with this tip.

printf '%s-%s-%s-%s\n' $(grep -v "[A-Z]\|'" /usr/share/dict/british | shuf -n 4)
2016-08-15 08:13:10
User: hendry
Functions: grep printf
1

https://xkcd.com/936/ introduced us to what actually is a good password. Here's such an implementation.

Credit: quinq on #suckless

find . -name '*.mp3' | sort | while read -r mp3; do echo -e "<h3>$mp3</h3>\n<audio controls src=\"$mp3\"></audio>"; done > index.html; python -m http.server
2014-03-24 15:01:49
User: hendry
Functions: echo find python read sort
Tags: audio browser
2

I tried a few curses based mp3 players for playing back choir practice songs for my wife.

Unfortunately none of the ones I tried were capable of scrubbing a track.

Firefox saves the day.

mplayer -af volume=10.1:0 $movie
2013-05-11 20:47:50
User: hendry
0

If a movie is too hard to hear, try the above command to make it louder.

inotifywait -m -r .
find -iname '*.jpg' -print0 | xargs -0 feh -d
2011-04-10 15:28:14
User: hendry
Functions: find xargs
Tags: picture images
2

So you are in directory with loads of pictures laying around and you need to quickly scan through them all

resize
2010-05-08 10:03:24
User: hendry
5

See the cols and lines and make sure the console it correctly configured for the screen size.

cat 1.tar.gz 2.tar.gz > 3.tar.gz; tar zxvfi 3.tar.gz
vim suite.js -c '%s!/\*\_.\{-}\*/!!g'
fromdos *
2010-03-18 16:51:58
User: hendry
6

The old dos2unix from sysutils has been deprecated on Debian systems to this tool.

HandBrakeCLI -i video.avi -o video.mp4
tar --exclude-vcs -cf src.tar src/