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

Check (partial) runtime-dependencies of Gentoo ebuilds
The output is only partial because runtime dependencies should count in also commands executed via system() and libraries loaded with dlopen(), but at least it gives an idea of what a package directly links to. Note: this is meaningful *only* if you're using -Wl,--as-needed in your LDFLAGS, otherwise it'll bring you a bunch of false positives.

Run bash on top of a vi session (saved or not saved), run multiple commands, instead of one at a time with :!(bashcommand), type exit and [enter] to get back to where you left off in vi.

See system users

Get first Git commit hash
https://git.kernel.org/cgit/git/git.git/commit/?id=ad5aeeded3295589b2573b143f754762a56f8f82

Get all IPs via ifconfig
and, a lot uglier, with sed: $ ifconfig | sed -n '/inet addr:/s/[^:]\+:\(\S\+\).*/\1/p' Edit: Wanted to be shorter than the perl version. Still think that the perl version is the best..

Generate a random password 30 characters long

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

show ls colors with demo
This can show all ls colors, with a demo.

How to pull out lines between two patterns
This command will display all lines between 2 patterns: word-a and word-b useful for grepping command outputs from file

interactive rss-based colorful commandline-fu reader perl oneliner (v0.1)
required packages: curl, xml2, html2text command is truncated, see 'sample output'


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: