This HOWTO contains those hard to find hints and tweekings that make Linux
a bit nicer.
</abstract>
<toc>
<sect>Introduction
<p>
Welcome to the <bf/Linux Tips HOWTO/, a list of neato tricks and optimizations that make Linux more fun. All I have in here right now are tips off of the top of my head, and tips from the old Tips-HOWTO(Why take out decent tips, right?). So send all your favorite hints and tips to me so I can put them in the next Tips-HOWTO.
Edit your /etc/syslog.conf, and put in the following line:
<tscreen><verb>
# Dump everything on tty8
*.* /dev/tty8
</verb></tscreen>
One caveat: <it/REMEMBER TO USE TABS!/ syslog doesn't like spaces...
<sect1> Moving directories between filesystems. <it/Alan Cox,/
<tt/A.Cox@swansea.ac.uk/
<p>
Quick way to move an entire tree of files from one disk to another
<tscreen><verb>
(cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)
</verb></tscreen>
<it>[ Change from cd /source/directory; tar....etc. to prevent possibility of trashing directory in case of disaster. Thanks to Jim Dennis, jadestar@rahul.net, for letting me know. -Maint. ]</it>
<sect1> Finding out which directories are the largest. <it/Mick Ghazey,/
<tt/mghazey@miso.lowdown.com/
<p>
Ever wondered which directories are the biggest on your computer? Here's how to find out.
<tscreen><verb>
du -S | sort -n
</verb></tscreen>
<sect1> The Linux Gazette
<p>
Kudos go to John Fisk, creator of the Linux Gazette. This is an excellent
e-zine plus, it's <bf/FREE!!!/ Now what more could you ask? Check it out at:
<tscreen><verb>
http://www.redhat.com/lg
</verb></tscreen>
While you're there, drop John Fisk a note telling him how wonderful an e-zine LG is.
<sect1> Pointer to patch for GNU Make 3.70 to change VPATH behavior.
<it/Ted Stern,/ <tt/stern@amath.washington.edu/
<p>
I don't know if many people have this problem, but there is a "feature" of GNU
make version 3.70 that I don't like. It is that VPATH acts funny if you give it
an absolute pathname. There is an extremely solid patch that fixes this, which
you can get from Paul D. Smith <tt><psmith@wellfleet.com></tt>. He also posts the
documentation and patch after every revision of GNU make on the newsgroup
`gnu.utils.bug` Generally, I apply this patch and recompile gmake on every
system I have access to.
<sect1> How do I stop my system from fscking on each reboot? <it/Dale Lutz,/
<tt/dal@wimsey.com/
<p>
Q: How do I stop e2fsck from checking my disk every time I boot up.
A: When you rebuild the kernel, the filesystem is marked as 'dirty' and
so your disk will be checked with each boot. The fix is to run:
rdev -R /zImage 1
This fixes the kernel so that it is no longer convinced that the
filesystem is dirty.
<em/Note: If using lilo, then add /<tt/read-only/ <em>to your linux setup in your lilo config file (Usually /etc/lilo.conf) </em>
<sect1>How to avoid fscks caused by "device busy" at reboot time.
<it/Jon Tombs,/ <tt/jon@gtex02.us.es/
<p>
If you often get device busy errors on shutdown that leave the filesystem in
need of an fsck upon reboot, here is a simple fix:
To <tt>/etc/brc</tt> or <tt>/sbin/brc</tt>, add the line
<tscreen><verb>
mount -o remount,ro /mount.dir
</verb></tscreen>
for all your mounted filesystems except /, before the call to umount -a. This
means if, for some reason, shutdown fails to kill all processes and umount the
disks they will still be clean on reboot. Saves a lot of time at reboot for
me
<sect1>How to find the biggest files on your hard-drive.
<p><it/Simon Amor,/ <tt/simon@foobar.co.uk/
<p>
<tscreen><verb>
ls -l | sort +4n
</verb></tscreen>
<p>
Or, for those of you really scrunched for space this takes awhile but works
great:
<p>
<tscreen><verb>
cd /
ls -lR | sort +4n
</verb></tscreen>
<sect1>How to print pages with a margin for hole punching. <it/Mike Dickey,/
<tt/mdickey@thorplus.lib.purdue.edu/
<p>
<tscreen><code>
#!/bin/sh
# /usr/local/bin/print
# a simple formatted printout, to enable someone to
# 3-hole punch the output and put it in a binder
cat $1 | pr -t -o 5 -w 85 | lpr
</code></tscreen>
<sect1>A way to search through trees of files for a particular regular expression.