This version builds on my command 8776 (Find the package a command belongs to on debian-based distros). So if you use that command to find package name then you could alternatively use following for
package summary:
function summpkg { dpkg -s $(whichpkg $1 | awk -F: '{print $1}'); }
Show Sample Output
Removes all kernels and corresponding packages except of the one you're currently using.
since awk was already there one can use it instead of the 2 greps. might not be faster, but fast enough
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....
No params Show Sample Output
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. Show Sample Output
completely remove those packages that leave files in debian / ubuntu marked with rc and not removed completely with traditional tools
Replace "user/sbin/sshd" with the file you would like to check. If you are doing this due to intrusion, you obviously would want to check size, last modification date and md5 of the md5sum application itself. Also, note that "/var/lib/dpkg/info/*.md5sums" files might have been tampered with themselves. Neither to say, this is a useful command. Show Sample Output
Replace the first part of the command above with the appropriate timezone string. Eg: 'Europe/London' or for UTC - 'Etc/UTC'. The appropriate string can be found from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones This is useful when your server is installed by a data centre (managed hardware, VPS, etc) and the timezone is not usually set to the one your prefer.
Recently in Debian Wheezy the dpkg command refuses to work with wildcards, so this is the one-liner alternative. (alternative to #13614)
The wajig package is not installed by default.
If you run dpkg --clear-selections or have otherwise selected installed packages for deinstall, but want to undo it, run this. It will set all installed packages back to installed status so that they won't be removed by commands like "dpkg -Pa"
Recently in Debian Wheezy the dpkg command refuses to work with wildcards, so this is the one-liner alternative.
I have this in my .bash_aliases and call it before running apt-get install or apt-get upgrade Example: alias apt-install='apt-update; apt-get install' alias apt-upgrade='apt-update; apt-get upgrade' function apt-update () { if [[ $(expr $(date +%s) - $(stat -c %X /var/lib/apt/periodic/update-success-stamp)) -gt 86400 ]]; then sudo apt-get update else echo apt is up to date fi }
its not the prettiest but it should do the job. This one liner removes all ubuntu packages whose name ends with *-dev
This command lists all currently installed packages in ubuntu in a single line, for example to use later with apt install. Show Sample Output
Use xargs command to make one line.
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: