lc-shell
lc-shell copied to clipboard
Add two more options to "less" command
In https://librarycarpentry.org/lc-shell/03-working-with-files-and-folders/index.html, when we mentioned "less" command in "Reading files" session, I found it would be very useful to introduce the following two items with "less":
- (Display line numbers)The "-N" option with less to display the file with line numbers, which is extremely useful when looking at log/error files, and
- (Pattern search) "$ less -pPATTERN filename", OR, once inside less, use "/" followed by your pattern to do interactive searching (forwards). "n" and "N" repeat the search in the forward and reverse direction, respectively.
Question. If this is an introduction to the shell I'm not sure if isn't throwing too much at the participants. I have to go back through the lesson and see if wildcards had been introduced yet. Other opinions?