Next: Return to my Home Page
Answers
- f
This command also gives the file name and its current length.
- .,.+3d
The '.' symbol means the current cursor line, so
+3 is a range of lines from the current cursor line to three lines
beyond that. The d on the end says delete this range.
- ?8/.7
The'?' means search backwards from the current position.
The '/' before the dot ('.') is required because otherwise the
dot is a wild-card which matches any single character.
- $-9,$d
The dollar ('$') symbol means end of file.
- / [0-9] [0-9] [0-9]
Search forward to find three adjacent characters
each in the range 0 to 9
- s/aa.*zz//
The search string here starts with 'aa' which is
followed by any number of single characters ('.*') and terminated
by 'zz'. The substitute the search string for nothing - hence
delete.
- g/&/s//and/g
The center part of this line substitutes the '&'
character for the word 'and'. The leading 'g' means for each line
in the file, and the trailing 'g' means for each occurrence on
the line.
Next: Return to my Home Page