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

Print only the odd lines of a file (GNU sed)
The tilde address operator is an extension of GNU sed. It won't work with POSIX sed.

Get My Public IP Address

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

Extract a bash function
I often need to extract a function from a bash script and this command will do it.

Clean up the garbage an accidental unzipping makes
List out all the names from the zip file and pass it to xargs utility to delete each one of them

Automatically rename tmux window using the current working directory
Adds a function that runs every time the prompt is rendered. The function grabs the CWD from PWD and issues a command to tmux to change the current window

Jump to a directory, execute a command and jump back to current dir

most used unix commands

Change prompt to MS-DOS one (joke)
This one eliminates the additional backslash at the end (which is not necessary)

List Threads by Pid along with Thread Start Time
This command will list all threads started by a particular pid along with the start time of each thread. This is very valuable when diagnosing thread leaks.


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: