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

pretend to be busy in office to enjoy a cup of coffee

cycle through a 256 colour palette
just for fun

delete all bitbucket repos via rest API v2 (req: jq and curl)
bitbucket paginates at around 1360 characters, so if you have several pages of repos in git hub you can just add "?page={1..4}" the url used to get all the repos. you can also use -v for the deletion curl if you want to see the response from the server.

Backup with SSH in a archive
$PRIVATEKEY - Of course the full path to the private key \n $HOST - The host where to get the backup \n $SOURCE - The directory you wish to backup \n $DESTINATION - The destination for the backup on your local machine

Compare an archive with filesystem
and you quickly know the files you changed

Grep colorized
Highlights the search pattern in red.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Blackhole any level zones via dnsmasq
Explanation It creates dnsmasq-com-blackhole.conf file with one line to route all domains of com zones to 0.0.0.0 You might use "address=/home.lab/127.0.0.1" to point allpossiblesubdomains.home.lab to your localhost or some other IP in a cloud.

rename anime fansubs
renames Anime Episodes to files, that can be parsed by sonarr & co

replace strings in file names
Uses vi style search / replace in bash to rename files. Works with regex's too (I use the following a script to fixup / shorten file names): # Remove complete parenthetical/bracket/brace phrases rename 's/\(.*\)//g' * rename 's/\[.*\]//g' * rename 's/\{.*\}//g' *


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: