Commands using grep (1,935)

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

List your largest installed packages (on Debian/Ubuntu)

how to find the active X (X11/xorg) username and DISPLAY variable
Requires consolekit (works in e.g. Ubuntu). Here x11-display is DISPLAY

Clear ARP table in linux.
Clears the "arp" table, without entering manually addresses (tested in Ubuntu).

Rename files in batch

Binary clock
cryptic version

Join lines split with backslash at the end
Joins each line that end with backslash (common way to mark line continuation in many languages) with the following one while removing the backslash.

Convert flv without re-encoding

Press ctrl+r in a bash shell and type a few letters of a previous command
In the sample output, I pressed ctrl+r and typed the letters las. I can't imagine how much typing this has saved me.

back up your commandlinefu contributed commands
Use `zless` to read the content of your *rss.gz file: $ zless commandlinefu-contribs-backup-2009-08-10-07.40.39.rss.gz

Determine next available UID
Typical usage would be in a script that would want the next open UID in a range (in this case 500-600)


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: