commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Requires the "wajig" package to be installed.
This is the fastest method to search the Debian package database.
Requires the dlocate package. The dlocate db updates periodically, but you may force an update with
'dpkg -S' just matches the string you supply it, so just using 'ls' as an argument matches any file from any package that has 'ls' anywhere in the filename. So usually it's a good idea to use an absolute path. You can see in the second example that 12 thousand files that are known to dpkg match the bare string 'ls'.
This command is useful when you want to install the same packages on another fresh OS install for example. To do that, use:
sudo dpkg --set-selections < LIST_FILE
Running 'cpan Module::Name' will install that module from CPAN. This is a simple way of using a similar command to install a packaged Perl module from a Debian archive using apt-get.
Compares two versions with dpkg. It is not always obvious what version dpkg/apt will consider to be more recent. Operators include the following :
* These treat an empty version as earlier than any version: lt le eq ne ge gt.
* These treat an empty version as later than any version: lt-nl le-nl ge-nl gt-nl.
* These are provided only for compatibility with control file syntax: < > >.
This command doesn't output anything. It only returns with status 0 or 1, hence the echo "y" || echo "n" to get an output.
Requires: imagemagick and graphviz
On Debian systems, displays a graph of package dependencies. Works also with other image formats, like svg :
apt-cache dotty bash | dot -T svg | display
On Debian systems, choose which command provides java. Works for all alternatives listed in /etc/alternatives.