Commands by inevitability (1)

  • Also useful with iostat, or pretty much anything else you want timestamped. Show Sample Output


    8
    vmstat 1 | awk '{now=strftime("%Y-%m-%d %T "); print now $0}'
    inevitability · 2009-07-17 07:41:57 4

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

Read funny developer comments in the Linux source tree
These are way better than fortune(6).

get partitions that are over 50% usage

Rename files in batch

Get a diff of two json arrays
jq is amazing for manipulating json on the commandline, but the developers have some weird ideas about how to handle shell redirections. This command works around them. Further reading: https://github.com/stedolan/jq/issues/1110

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Get last sleep time on a Mac

gzip compression with progress bar and remaining time displayed

Lists all directories under the current dir excluding the .svn directory and its contents

Create a new file

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:


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: