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

reapair all mySQL/mariaDB databases
while dumping database if you see following error/warning than you have to repair broken tables/rows

Put terminal into vi mode
For if you want to use vi key bindings in the terminal

Ride another SSH agent
Must be done as root - will cause subsequent ssh connections to use the identities available via the [user]'s agent socket.

remote-pbzip2 and transfer a directory to local file

sends a postscript file to a postscript printer using netcat

Create a backup of the file.
It will create a backup of the filename. The advantage is that if you list the folder the backups will be sorted by date. The command works on any unix in bash.

Blink Caps Lock on HDD activity
Some computers these days don't have an HDD activity light, but they still have a useless caps-lock, so why not re-purpose that light to show HDD activity? Requires setleds and dstat and probably needs to run as root.

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"

Generate random IP addresses
It never ends

pngcrush all .png files in the directory
Find all pngs in directory structure and pngcrush them, none destructive. You can just remove the "{}.crush" part if you want destructive.


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: