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

ram usage most top 10 process

Get Unique Hostnames from Apache Config Files
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. A slightly shorter version.

Enable color pattern match highlighting in grep(1)
This will affect all invocations of grep, even when it is called from inside a script.

Download an entire static website to your local machine
Very nice command when you want to download a site locally to your machine, including images, css and javascript

Prints a file leaving out all blank lines and comment-only lines
Does not print any line that either: - is empty - contains only spaces or tabs - starts with # - starts with spaces/tabs followed by a #

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

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Send a signed and encrypted email from the command line
A very simple command to send a signed and encrypted message from the command line using GPG Keys

Execute a sudo command remotely, without displaying the password
The ssh command alone will execute the sudo command remotely, but the password will be visible in the terminal as you type it. The two stty commands disable the terminal from echoing the password back to you, which makes the remote sudo act as it does locally.

Generate random valid mac addresses
Ruby version. Also, a perl version: $perl -e 'printf("%.2x.",rand(255))for(1..5);printf("%.2x\n",rand(255))'


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: