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

Calculate days on which Friday the 13th occurs
I removed the dependency of the English language

Generate random valid mac addresses
First set the variable $hexchars: $hexchars="0123456789ABCDEF" Change the number in the first for loop if you need less then 1200 mac addresses

Binary difference of two files
Upload/download newer version of any file with less size and high speed. To remake the new file use $bspatch

clear MyDNS-ng cache
Occasionally, to force zone updating, cache flush is necessary. This command is better than restart the mydns daemon.

Quickly move the cursor to different parts of the command line based on a mark.
Use 'ctrl-@' to set a mark. See the first comment for a better explanation.

Trim png files in a folder
That should be a short as it can get.

Youtube-dl gone stale on you/stopped working (Ubuntu)?
If you update youtube-dl from the repos, it becomes out-of-date quickly. Luckily, it can auto-update.

Top 20 commands in your bash history

find builtin in bash v4+
This command will give you the same list of files as "find /etc/ -name '*killall' | xargs ls -l". In a simpler format just do 'ls /etc/**/file'. It uses shell globbing, so it will also work with other commands, like "cp /etc/**/sshd sshd_backup".

Submit data to a HTML form with POST method and save the response
Assume that you have a form , in the source look for something similar to : input name="rid" type="TEXT" input name="submit" value="SUBMIT" type="SUBMIT" align="center" Then exec the command to get the response into html More info : www.h3manth.com


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: