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
Python Alternative

Unix alias for date command that lets you create timestamps in ISO 8601 format
I often need to add a timestamp to a file, but I never seem to remember the exact format string that has to be passed to the date command to get a compact datetime string like 20090220T231410 (i.e yyyymmddThhmmss, the ISO 8601 format popular outside the US)

monitor my process group tree

show each new entry in system messages as a popup
It willl popup a message for each new entry in /var/log/messages found on the notify-send howto page on ubuntuforums.org. Posted here only because it is one of the favourites of mine.

Find files changed between dates defined by ctime of two files specified by name
This command finds all the files whose status has changed between the ctime of the older and newer . Very useful if you can see from an ls listing a block of consecutive files you want to move or delete, but can't figure out exactly the time range by date.

Paste hardware list (hwls) in html format into pastehtml.com directly from console and return URI.
In this Linux box i need to become root to get the complete hardware list, so either become root before or call it with sudo as i did, your choice.

quickly backup or copy a file with bash
This inserts timestamp instead of .bak extension.

Find the package that installed a command

Get line number 12 (or n) from a file
Extracts only file number 12 from file. It's meant for text files. Replace 12 with the number you want. First line starts at 1 not 0. We use q on next line so doesn't process any line more.

Backup with versioning
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by EVACopy http://evacopy.sourceforge.net


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: