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

Better git diff, word delimited and colorized
Define a git alias then git dcolor

Monitor cpu freq and temperature
This is maybe helpfull from system overheat on your linux box

Download all Red Hat Manuals - A better way by user Flatcap
Let's give Flatcap credit for this elegant solution, instead of leaving it hidden as a comment. Tested on RHEL6 and it works. Nice and clean.

Echo the latest commands from commandlinefu on the console
Self-referential use of wget.

loop over a set of items that contain spaces
If you want to operate on a set of items in Bash, and at least one of them contains spaces, the `for` loop isn't going to work the way you might expect. For example, if the current dir has two files, named "file" and "file 2", this would loop 3 times (once each for "file", "file", and "2"): $ for ITEM in `ls`; do echo "$ITEM"; done Instead, use a while loop with `read`: $ ls | while read ITEM; do echo "$ITEM"; done

re-assign line numbers

all out
How to force a userid to log out of a Linux host, by killing all processes owned by the user, including login shells:

Create commands to download all of your Google docs
Create commands to download all of your Google docs to the current directory.

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

sum numbers in the file (or stdin)
add integers from the stdin and print out the result usually, cat /tmp/file | echo $(($(tr '\n' '+')0))


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: