Lists all installed kernels minus the current one. This is useful to uninstall older kernels that take too much space on /boot partition. Show Sample Output
Reconfigures time zone in Ubuntu, which I cannot figure out how to do through the GUI. Worked like a charm to set my time zone to CEST from EDT.
Sometimes, simpler is better.
Maybe not clean with big package and too long argument. But return every file who can be executed.
Remove old kernels (*-generic and *-generic-pae) via apt-get on debian/ubuntu based systems. Tested on ubuntu 10.04 - 12.04.
After you install/remove lots of packages, there are many packages marked with 'rc'. This script help you to purge these packages, it will save some spaces from your disk.
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. Show Sample Output
In Debian based distros, this command will list 'binutils' package details which contains 'nm' command. You can replace 'nm' to any other command.
Need admin right to run dpkg-query Show Sample Output
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 Show Sample Output
I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name. The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well. Show Sample Output
Should work on all systems that use dpkg and APT package management. Show Sample Output
extracts the debian-package $debfile to $extractdir, including all packaging-information. to repack the package, just type:
dpkg-deb -b $extractdir
The ^python$ is a package name patten. You can change whatever you want. Show Sample Output
This script compares the modification date of /var/lib/dpkg/info/${package}.list and all the files mentioned there. It could be wrong on noatime partitions. Here is non-oneliner: #!/bin/sh package=$1; list=/var/lib/dpkg/info/${package}.list; inst=$(stat "$list" -c %X); cat $list | ( while read file; do if [ -f "$file" ]; then acc=$(stat "$file" -c %X); if [ $inst -lt $acc ]; then echo used $file exit 0 fi; fi; done exit 1 ) Show Sample Output
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.
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
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: