Check These Out
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}.
Google text-to-speech in your local language or in language of choice via country code switch (ISO 639-1).
list zipfile info in long Unix ``ls -l'' format.
Need admin right to run dpkg-query
In order to write bash-scripts, I often do the task manually to see how it works. I type ### at the start of my session.
The function fetches the commands from the last occurrence of '###', excluding the function call. You could prefix this with a here-document to have a proper script-header.
Delete some lines, add a few variables and a loop, and you're ready to go.
This function could probably be much shorter...
Explanation:
* The date command evaluated to today's date with blank padded on the left if single digit
* The grep command search and highlight today's date
* The --before-context and --after-context flags displays up to 6 lines before and after the line containing today's date; thus completes the calendar.
I have tested this command on Mac OS X Leopard and Xubuntu 8.10
Clone a root partition. The reason for double-mounting the root device is to avoid any filesystem overlay issues. This is particularly important for /dev.
Also, note the importance of the trailing slashes on the paths when using rsync (search the man page for "slash" for more details). rsync and bash add several subtle nuances to path handling; using trailing slashes will effectively mean "clone this directory", even when run multiple times. For example: run once to get an initial copy, and then run again in single user mode just before rebooting into the new disk.
Using file globs (which miss dot-files) or leaving off the trailing slash with rsync (which will create /mnt/target/root) are traps that are easy to fall into.
Shows all block devices in a tree with descruptions of what they are.
Useful to detect number of tabs in an empty line, DOS newline (carriage return + newline).
A tool that can help you understand why your parsing is not working.
This command uses -newerXY to show you the files that are modified since a specific date. I recommend looking for "-newerXY" on the manpage to get the specifics.