Dana Dahlstrom
2002.03.20
:%s/I/We/g
:%s/purple/orange/g or /purple followed by cworange
or any other description of a working solution
3G or :3 goes to line 3
16| goes to column 16 in the current line
2bw or bbw
$ 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).
3k or kkk
3G or :3 goes to line 3; "a2yy yanks lines 3 and 4
into register a
4G or :4 (or j from line 3) goes to line 4; "ap
puts the two lines from register a below the cursor
1G or :1 goes to line 1; O begins a new line above
the cursor and enters insert mode; ESC or Ctrl-[ exits
insert mode after typing title and blank line
H moves the cursor to the first
non-blank character of the line at the top of the screen; L moves the
cursor to the first non-blank character of the line at the bottom of the
screen.
:3,$d (or 3GdG if file has at least 3 lines)
:wq writes the current file and quits
grep "see" burgess.txt | grep -v "seen"
grep -v "cow" burgess.txt
grep "^$" burgess.txt
sort -k3,3 burgess.txt
cut -c5,6 burgess.txt | sort > burgess_cols5and6.srt
wc burgess.txt
ls
ls > listoffiles.txt
ls | wc -l
cd ..
cd - or cd so103class
mkdir schlemiel
cp burgess.txt schlemiel
{ print $0 } or just { print }
{ if ($0 ~ /u/) print } or just /u/
{ print $NF }
{ print $0, NF }
BEGIN {
for ( x = 1; x <= 3; ++x ) {
print x
}
}
{ tw[$2] += $3 }
END {
t_w_o = "Total weight of"
print t_w_o, "females is", tw[2], "pounds"
print t_w_o, "males is", tw[1], "pounds"
print t_w_o, "everyone is", tw[1] + tw[2], "pounds"
}
{ ++num_people_named[$1] }
END {
for (name in num_people_named) {
print name, num_people_named[name]
}
}
sort