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

Send an email from the terminal when job finishes
Might as well include the status code it exited with so you know right away if it failed or not.

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

Convert df command to posix; uber GREPable
It is a pain grep-ing/sed-ing/awk-ing plain old df. POSIX it!

Find an installed app

Use mtr to create a text file report
The report mode of mtr produces a text formated result of the mtr run using the number of ping cycles stated by the command. This text file could then be attached to an email with ease. I use this also without the ">" portion when writing email from within mutt using VI from the command mode with ":r !mtr --report --report-cycles 10 www.google.com" to actually input the same output in the body of an email.

Prettify an XML file
Generated XML files often are poorly formatted. Use this command to properly indent and normalize the file in-place.

Suspend, background, and foreground a process
1. Start a process, such as 'top' command 2. # suspend process {ctrl-Z} 3. # background process bg 4. # list all backgrounded jobs jobs 5. # bring it back to foreground fg

Print all git repos from a user

Send a local file via email
Another way of sending an attachment. -s : subject file : file to be sent

ROT13 whole file in vim.
gg puts the cursor at the begin g? ROT13 until the next mov G the EOF


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: