|
 |
 |
 | |
 |
Here are some unix commands and things that I seem to run into often. I thought I would share them with you. (Actually, I put them here because I can never seem to remember them, and here is as good a place as any, but enjoy anyway...)
Need to get rid of those pesky ^M in java files on unix boxen?
Just cut and paste the follwing script into a file (call it dos2unix or something) and then make it executable (chmod 755). Call it like: dos2unix myfile.txt
#!/bin/sh
tr -d "\015" < $1 > $1.tmp
mv $1.tmp $1
How to delete files in the current directory, and below that contain the string "foo":
find . | grep "foo" | xargs rm
This one is a request from Jamie. How to tar and unzip a foo.tar.gz (or foo.tgz) file and keep the archive around. It\'s super easy, and just one line. (This is also assuming that the tar you are using is gnutar)
tar xvzf foo.tar.gz
Here\'s how to read packets going to your local webserver. You can use a little unix program called tcpflow to do this, which compiles fine on Mac OS X.
sudo chmod 775 /dev/bpf*
tcpflow -csu -i lo0 port 80
Print out your environment variables in tcsh format.
perl -e \'foreach (sort keys %ENV) { print "setenv $_ $ENV{$_} \n"; }\'
|
|  |
 |
All things copyright © 2001, 2002 August Mueller
|

|