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

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

archlinux: check which repository packages have updates available
Shows which packages from the official repositories (not aur) have updates available. For most accurate output, the mirrors and package lists should be up to date.

Check if your desired password is already available in haveibeenpwnd database. This command uses the API provided by HIBP

Binary clock
Fun idea! This one adds seconds and keeps running on the same line. Perl's probably cheating though. :)

Bytebeat
Never ending music, generated via a C snippet, piped to aplay. Taken from: http://canonical.org/~kragen/bytebeat/

Show one line summaries of all DEB packages installed on Ubuntu based on pattern search
I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name. The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well.

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"

Replace all backward slashes with forward slashes
Use -i to edit file directly: sed -i 's|\\|\/|g' file

VIM: when Ctrl-D and Ctrl-U only scroll one line, reset to default
Resets the scroll parameter to the default (half the rows in the current window). The scroll parameter can be inadvertently set to 1, e..g., if you type '1 Ctrl-D' or '1 Ctrl-U' in normal mode.

Run entire shell script as root
Placing sudo in the shebang line of a shell script runs the entire thing as root. Useful for scripts designed to, e.g. automate system upgrades or package manager wrappers — makes prepending everything with sudo no longer necessary


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: