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

Create an SSH tunnel for accessing your remote MySQL database with a local port

Cut the first 'N' characters of a line
You can also cut charactes starting from X to N.

Split a tarball into multiple parts
Create a tar file in multiple parts if it's to large for a single disk, your filesystem, etc. Rejoin later with `cat .tar.*|tar xf -`

Get max number of arguments
Get max number of arguments that can be accepted by the exec() system call.

List all installed kernels on Ubuntu except current one
Lists all installed kernels minus the current one. This is useful to uninstall older kernels that take too much space on /boot partition.

Probably, most frequent use of diff
This form is used in patches, svn, git etc. And I've created an alias for it: alias diff='diff -Naur --strip-trailing-cr' The latter option is especially useful, when somebody in team works in Windows; could be also used in commands like $ svn diff --diff-cmd 'diff --strip-trailing-cr'...

get the full description of a randomly selected package from the list of installed packages on a debian system
I put this command on my ~/.bashrc in order to learn something new about installed packages on my Debian/Ubuntu system each time I open a new terminal

Create an eicar.com test virus
Test whether real-time virus detection is working by running this command and checking for eicar.com in /tmp. Requires real-time scanning to be enabled and active on the /tmp directory. If scanning is active, the file should be quarantined/deleted (depending on your settings) moments after running this command. If not, the (harmless) test file should remain in your /tmp directory.

Find the package that installed a command

Arguments too long


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: