Edit your /etc/syslog.conf, and put in the following line:
# Dump everything on tty8
*.* /dev/tty8
One caveat: REMEMBER TO USE TABS! syslog doesn't like spaces...
ohammers@cu-online.com
Create a file called rmcores(the author calls it handle-cores) with the following in it:
#!/bin/sh
USAGE="$0 <directory> <message-file>"
if [ $# != 2 ] ; then
echo $USAGE
exit
fi
echo Deleting...
find $1 -name core -atime 7 -print -exec rm {} \;
echo e-mailing
for name in `find $1 -name core -exec ls -l {} \; | cut -c16-24`
do
echo $name
cat $2 | mail $name
done
And have a cron job run it every so often.
A.Cox@swansea.ac.uk
Quick way to move an entire tree of files from one disk to another
(cd /source/directory && tar cf - . ) | (cd /dest/directory && tar xvfp -)
mghazey@miso.lowdown.com
Ever wondered which directories are the biggest on your computer? Here's how to find out.
du -S | sort -n
Kudos go to John Fisk, creator of the Linux Gazette. This is an excellent e-zine plus, it's FREE!!! Now what more could you ask? Check it out at:
http://www.redhat.com/lg
While you're there, drop John Fisk a note telling him how wonderful an e-zine LG is.
stern@amath.washington.edu
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 <psmith@wellfleet.com>
. 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.
dal@wimsey.com
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.
Note: If using lilo, then add read-only
to your linux setup in your lilo config file (Usually /etc/lilo.conf)
jon@gtex02.us.es
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 /etc/rc.d/init.d/halt
or /etc/rc.d/rc.0
, add the line
mount -o remount,ro /mount.dir
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.
Simon Amor, simon@foobar.co.uk
ls -l | sort +4n
Or, for those of you really scrunched for space this takes awhile but works great:
cd /
ls -lR | sort +4n
mdickey@thorplus.lib.purdue.edu
#!/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
rockwell@nova.umd.edu
I call this script 'forall'. Use it like this:
forall /usr/include grep -i ioctl
forall /usr/man grep ioctl
Here's forall:
#!/bin/sh
if [ 1 = `expr 2 \> $#` ]
then
echo Usage: $0 dir cmd [optargs]
exit 1
fi
dir=$1
shift
find $dir -type f -print | xargs "$@"
tolnas@nestor.engr.utk.edu
Here is a simple two-liner which recursively descends a directory hierarchy removing emacs auto-save (#) and backup (~) files, .o files, and TeX .log files. It also compresses .tex files and README files. I call it 'squeeze' on my system.
#!/bin/sh
#SQUEEZE removes unnecessary files and compresses .tex and README files
#By Barry tolnas, tolnas@sun1.engr.utk.edu
#
echo squeezing $PWD
find $PWD \( -name \*~ -or -name \*.o -or -name \*.log -or -name \*\#\) -exec
rm -f {} \;
find $PWD \( -name \*.tex -or -name \*README\* -or -name \*readme\* \) -exec gzip -9 {} \;
simon@foobar.co.uk
ps -aux | sort +4n
-OR-
ps -aux | sort +5n