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

Force the script to be started as root
Place this code at the beginning of your script to ensure that it can only be executed by the root.

Remove all unused kernels with apt-get
This should do the same thing and is about 70 chars shorter.

Remind yourself every 15 minutes (repeated reminders)
Note: 1) -n option of watch accepts seconds 2) -t option of notify-send accepts milliseconds 3) All quotes stated in the given example are required if notification message is more than a word. 4) I couldn't get this to run in background (use of & at the end fails). Any suggestions/improvements welcome.

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"

Capture all plaintext passwords

Get your X11 screen mode

Find last 50 modified files

Python extract json

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"

Diff 2 file struct - Useful for branch diff and jars diff(uncompressed)
This is usefull to diff 2 paths in branches of software, or in different versions of a same zip file. So you can get the real file diff.


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: