First piece of advice, especially if you're new to Linux and UNIX in general: Choose the distribution that suits your purposes and one you feel comfortable with, and stick at it.
If you're looking at a server, then you'll want to avoid desktop-oriented distributions. The *BSDs (Especially FreeBSD) or CentOS are good server choices. Fedora and SuSE are others that are very capable after the extras have been pared away
Desktop users will want the opposite - a good desktop experience, strong laptop support, plenty of available applications. Ubuntu concentrates on this area, with Fedora also a good choices.
If you're not 100% sure or want a look at a particular version without blowing away any existing data, many have “Live CD” versions available, for example
This is fairly simple stuff, but you'll be amazed how often folks screw it up and find themselves in strife.
First simple rule:
Plan in advance!
If you have a firm purpose in mind for the box, then choose appropriately. If it's a database box, then a large /var partition is advisable. Webserver / mailserver with plenty of users? then give extra to /home.
Some folks have separate partitions for /tmp or /usr - not me. I can see mounting the latter read-only as a benefit, but it's fairly small.
If it's a Linux box, give at least 100mb for a /boot partition. It will save your bacon when rescue attempts are needed, plus some installers (like anaconda on which Fedora / CentOS / Red Hat installers are based) will prod you if you don't have one.
Take swap into account, as it will need it's own partition.
If you're comfortable with LVM and have space for more drives, use it appropriately.
This should be a given, but in my experience too many don't do it, or do it infrequently.
Remember the old BOFH axiom: All software sucks.
It will have bugs, it will have security holes (yeah, even yours djb, even if you don't admit them). Update often to keep on top of these. This is as true for desktop users as it is for server admins.
If your distribution is old, then consider upgrading - the only exception would be for machines with software (usually proprietary) that is only certified / linked against libraries contained in old distros.
Fortunately if you have a well-backed distribution (Red Hat Enterprise or even Ubuntu LTS) then your vendor should take care of that for you.
Update utilities:
If you have Red Hat / CentOS or older versons of Fedora, up2date is the appropriate tool for your needs. For regular checks and updates, ensure that it's daemonised counterpart (rhnsd) is running.
Fedora users with versions up to FC5 have ”yum” (Yellowdog Updater, Modified). There's an init script in newer yum versions that allows you to set up a semi-automatic fetch-and-install of newer updates (in essence, it performs a “yum update” at a time specified via /etc/cron.daily entries
Fedora Core 6 and up have ”yum-updatesd” to perform this task, but beware it's a memory hog and requires a little configuration, so it knows to notify via syslog entry (and thus pickup in logwatch output) email or D-BUS (the latter useful for desktops, as you'll get a nice notification in your system notification applet when things are available)
Fedora Extras (and almost certainly EPEL in the near future) have the “yum-utils” package, which contains some extremely handy scripts for managing the package collection.
If you simply wish to list those packages no longer available in any of the configured repositories (local or obsoleted packages) simply invoke “package-cleanup –orphans”
If you want to clean out unused libraries no longer needed by locally installed applications, then “package-cleanup –leaves” will give you a list of such packages (which you can then pipe into yum itself as you wish)
”rpm -qa –last | head -10” will give you the last 10 packages installed on the system. Replacing ”head -10” with ”tail -10” gives the oldest 10 packages.
Exim is the MTA of choice where I work - not my personal preference but it does have some very useful means of managing and visualising mail queues.
exim -bp will show the current queue (a la mailq. Issuing exim -bpc will show just the count.
exim -Mrm removes messages by Message-Id - useful for piped commands.
exiqgrep -z -i shows frozen messages' Message-IDs; use the above removal syntax in a pipe to remove them.
exim -M runs the queue (a la sendmail -q
To see what sender / recipient destination domains are pending, as well as numbers, try exiqgrep | exiqsumm
exigrep <string> <logfile> makes for more intelligent and meaningful log searches than plain grep.
This is actually fairly easy and most modern kernels and e2fsprogs packages will happily supply you with the tools to do so.
Add directory indexing to a partition using the following command:
tune2fs /dev/sdXX -O dir_index (Note: this can be run while mounted)
This will immediately add directory hash indexing to the partition on the device supplied, but only for new directories. To add / optimise old directories, you need to run the following with the partition unmounted:
e2fsck -fD /dev/sdXX
…this will force a filesystem check (-f) with optimisation/reindexing of directories (-D) - see e2fsck(8) for more info.