Dana Dahlstrom
2002.02.13
:%s/utta/utter/g
:%s/Calcutter/Calcutta/g or /Calcutter
followed by cwCalcutta or any other description of a working solution
3G or :3 goes to line 3
11| goes to column 11 in the current line
2h4l or hhllll
$ goes to the end of the line
4G or :4 (or j from line 3) goes to line 4. ^
goes to the first non-blank character. 0 goes to the first
character even if blank. Also, 4G and :4 already go to the first
non-blank character (j doesn't).
2k or kk
6G or :6 goes to line 6; dd deletes the line
p puts the text after the cursor
6G or :6 goes to line 6; "add deletes the line into
register a
"aP puts the text from register a before the cursor
1G or :1 goes to line 1; A appends at the end
of the line
1G or :1 goes to line 1; I inserts
before the first non-blank character on the line.
H goes to the first non-blank
character of the line at the top of the screen; L goes to the first
non-blank character of the line at the bottom of the screen.
:wq writes the current file and quits
grep "t[eoia]n" oink.txt
grep "[A-Z][a-h2-6, ][357]"
grep -v "[A-Z][a-h2-6, ][357]"
grep "^[A-Z][a-h2-6, ][357]"
grep "[A-Z][a-h2-6, ][357]$"
grep "^$"
sort -k1,1 clean_limerick.txt
ls
ls > listoffiles.txt
ls | wc -l
cd ..
cd - or cd so103class
mkdir schlemiel
{ print $0 } or just { print }
{ if ($2 = 2) print =
{
sex = $2
if (sex == 1) sexmales = sexmales + 1
if (sex == 2) sexfemales = sexfemales + 1
}
END {
print sexmales, "males"
print sexfemales, "females"
}
BEGIN {
for ( x = 3; x <= 10; x = x + 1 ) {
print x
}
}