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

Count lines of source code excluding blank lines and comments
Much more accurate than other methods mentioned here straight out of the box.

Convert camelCase to underscores (camel_case)
Useful for switching over someone else's coding style who uses camelCase notation to your style using all lowercase with underscores.

Check if a package is installed. If it is, the version number will be shown.
If the first two letters are "ii", then the package is installed. You can also use wildcards. For example, . $ dpkg -l openoffice* . Note that dpkg will usually not report packages which are available but uninstalled. If you want to see both which versions are installed and which versions are available, use this command instead: . $ apt-cache policy python

List all symbolic links in current directory
For those who don't have the symlinks command, you can use readlink. This command is not straightforward because readlink is very picky. The backslash in front of 'ls' means not to use an alias (e.g. color escape codes from an aliased 'ls' could mess up readlink), and the -1 (one) means to print the entries separated by newlines. xargs -l (the letter L) means to process each input separated by newlines as separate commands.

Download a file and uncompress it while it downloads
This will uncompress the file while it's being downloaded which makes it much faster

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

analyze traffic remotely over ssh w/ wireshark
When using tcpdump, specify -U option to prevent buffering.

display a one-liner of current nagios exit statuses. great with netcat/irccat

extract all urls from firefox sessionstore
This will extract all of the urls from a firefox session (including urls in a tab's history). The sessionstore.js file is in ~/.mozilla/firefox/{firefox profile}

youtube2m3u
generate playlists from youtube ( or othre things that support yt-dlp)


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: