An alternative without aptitude.
If, for example, you want to remove all kernels and headers but the last three versions, you can't use one of that magic all-in-one "remove old stuff" commands. With this simple but elegant command you can remove a range of versions, or a list of versions with e.g. {14,16,20}. Show Sample Output
Some command names are very different from the name of the package that installed them. Sometimes, you may want to find out the name of the package that provided a command on a system, so that you can install it on another system. Show Sample Output
The vaule is expressed in megabytes Show Sample Output
Extracting .gz files and placing the output in another directory in one command line is convenient thing. I just followed some how-to to install Nagios on Ubuntu Lucid Lynx but they give the method to install from archives. I wished to install from the repository. If you do so some files are missing. I've not tested yet but this is an example command line I did to extract sudo sh -c 'gunzip -c /usr/share/doc/nagios3-common/examples/template-object/templates.cfg.gz > /etc/nagios3/objects/templates.cfg' We need privilege to write the destination file. Show Sample Output
This will print the name of every installed package on a Debian system.
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.
Flush the DNS cache under Ubuntu (Debian?)
Requires that bash has extglob enabled: shopt -s extglob
# AllInOne: Update what packages are available, upgrade to new versions, remove unneeded packages # (some are no longer needed, replaced by the ones from ap upgrade), check for dependencies # and clean local cached packages (saved on disk but not installed?,some are needed? [this only cleans unneeded unlike ap clean]). # aliases (copy into ~/.bashrc file): alias a='alias' a ap='apt-get' a r='ap autoremove -y' a up='ap update' a u='up && ap upgrade -y --show-progress && r && ap check && ap autoclean' # && means "and run if the previous succeeded", you can change it to ; to "run even if previous failed". I'm not sure if ap check should be before or after ap upgrade -y, you can also change the alias names. # To expand aliases in bash use ctrl alt e or see this ow.ly/zBKHs # For more useful aliases go to ow.ly/zBMOx
Works for Debian an sons distros. With a bad internet connection sometime I download the updateable packages in another place, but I can't be there all time takes upgrade every packages... so I execute this for update only packages that are in Debian's apt cache. Using the 'sudo bash -c' for no asking every time apt-get need sudo permition.
Someone quoted Pooh in an init script. Let's see it! (Probably only works on Debian & friends) Show Sample Output
Worked well on ubuntu
Default volume group in Ubuntu is ubuntu-vg and the logical volume is ubuntu-lv, so the provided command will resize the disk to utilize 100% of the available space. Show Sample Output
release upgrades are major upgrades as from 8.04 to 8.10 or from 8.10 to 9.04
update-manager-core must be installed:
sudo apt-get install update-manager-core
in some cases you must edit '/etc/update-manager/release-upgrades' and set 'Prompt=normal'
forces user to rw, group to r, and other to no access. files will not be marked executable. directories will be executable for users and groups only. Show Sample Output
This command works at least in 9.04+
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: