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

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

Tail a log-file over the network
This one is tried and tested for Ubuntu 12.04. Works great for tailing any file over http.

Format date/time string for a different day
The "date' command has options to easily format the date, day, month, time, etc. But what if you want a relative date or time. Like, I wanted yesterday's date in a particular format. You may want the exact date of "2 months ago" or "-3 days" nicely formatted. For that, you can use this command. The --date option takes fuzzy parameters like the ones mentioned in the previous sentence.

Save your terminal commands in bash history in real time
Use this command if you want your terminal commands be saved in your history file in real time instead of waiting until the terminal is closed

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.

Replace spaces in a file with hyphens

Create a file of a given size in linux

Using Git, stage all manually deleted files.
You'll probably want to pass in the -rf options if you have to delete a directory or something.

Selecting a random file/folder of a folder
Also looks in subfolders

Get Dollar-Euro exchage rate
You can get others rates changing the "EUR/US" part. look at the url: wap.kitco.com/exrate.wml to get more options.


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: