The meeting itself was held at the IServ company, an Internet Service
Provider located in Grand Rapids, Michigan. We gathered in the conference
room at IServ at about 7:15 PM, and went over the commands shown below, and
had a short Q&A period. After that, we took a tour of the IServ facility,
and saw the hardware required to be a leading ISP such as IServ. We then
returned to the conference room for some what more general Q&A on what we
had seen, and on the state of the Internet, the communications industry,
and the computer business in general. Over 20 peopple attended this meeting,
which everyone from Kalamazoo agreed was a success, well worth the 60 mile-
or-so drive. Thanks to Kevin Mitchell of IServ for being our host.
Linux Command Utilities To Know
cat
Displays a file on-screen
cat file
cat -n (displays the line number)
cat file1 file2 file3 > big.file
less
Displays information one screen at a time
less file
Goes backwards
Faster for displaying large files
head
Displays the first few lines of a file (10 Default)
head file
head -5 (displays first 5 lines)
tail
Displays the last few lines of a file (10 Default)
tail file
tail -5 (displays last 5 lines)
tail -r (displays the last 10 lines in reverse order)
tail -f (displays a file as it grows)
grep
Finds lines in one or more files that match a pattern
grep text files
grep -i (not case sensitive)BR>
grep -3 (prints 3 lines before and after the match)
grep -A 3 (prints 3 lines after the match)
grep -B 3 (prints 3 lines before the match)
grep -c (counts the number of matches)
grep -n (gives you the line number along with the line)
grep -h (gives no filename when multiple files are searched)
grep -v (gives what doesn't match the pattern)
grep -l (give you the files that have a match to the pattern)
wc
Counts the number of words, lines or characters in a file
wc -l file (counts lines)
sdiff
Compares 2 files side by side
sdiff -w 80 file1 file2 (sets the width to 80 columns)
uniq
Removes similar lines in a file
uniq -c file (prints the number of times each line occurred)
tee
Writes output to a file and to the screen
grep thing file1 | tee file2
tr
Translates or deletes characters in a file
cat blah | tr ":" ";"
cat blah | tr A-Z a-z
cat blah | tr -d ":"
awk
awk '{print $1}'
awk -F : '{print $3"\t"$1}'
awk '{sum+=$1;print$1"\t"sum)'
sed
sed '1,9d' (shows line 10 to the end of a file)
Use xargs to help kill processes
ps ax | grep http | awk '{print $1}' | xargs -n1 kill -9
Script on the command line
while true
do
(whatever)
done
tar & untar in one command line
tar -cvf - kevin/ | (cd /tmp; tar -xvf -)
Unfunk your terminal window
Run your last command