commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
The other commands were good, but they included packages that were installed and then removed.
This command only shows packages that are currently installed, sorts smallest to largest, and formats the sizes to be human readable.
This functionality seems to be missing from commands like dpkg. Ideally, I want to duplicate the behavior of rpm --verify, but it seems difficult to do this in one relatively short command pipeline.
This will take the packages matching a given `apt-cache search` query (a collection of AND'd words or regexps) and tell you how popular they are. This is particularly nice for those times you have to figure out which solution to use for e.g. a PDF reader or a VNC client.
Substitute "ubuntu.com" for "debian.org" if you want this to use Ubuntu's data instead. Everything else will work perfectly.
Remove old kernels (*-generic and *-generic-pae) via apt-get on debian/ubuntu based systems. Tested on ubuntu 10.04 - 12.04.
also use: update-alternatives --config gnome-www-browser
locating packages held back, such as with "aptitude hold "
small update for this command to work with linux kernels 3.x
Marks all manually installed deb packages as automatically installed. Usefull to combine with
apt-get install <all manually packages that we want>
to have a clean installed debian-based system.
If any changes have been made to the package while it was unpacked (ie, conffiles files in /etc modi‐fied), the new package will inherit the changes.
This way you can make it easy to copy packages from one computer to another, or to recreate packages that are installed on your system, but no longer available elsewhere.
Note: dpkg-repack will place the created package in the current directory.
Shows all configurations to apt and dpkg, rarely changed, you probably still have the default configuration. Go ahead and explore your configuration if you dare, perhaps change your apt-cache directory, Dir::Cache "var/cache/apt/"; or the names of the log files.
Uses dpkg -S or apt-file to find the file you want and shows results in various ways. Available at https://github.com/Pipeliner/configs/blob/master/bin/pacof
pacof -xp 'bin/[^/]*mixer'
# Search for an available package on Debian systems using a regex so it only matches packages starting with 'tin'.
This will print the name of every installed package on a Debian system.
after kernel build with make deb-pkg, I like to install the 4 newest packages that exist in the directory. Beware: might be fewer for you....
since awk was already there one can use it instead of the 2 greps. might not be faster, but fast enough