how perform grep operation on all files in a directory

后端 未结 5 1966
情书的邮戳
情书的邮戳 2020-12-02 04:21

Working with xenserver, and I want to perform a command on each file that is in a directory, grepping some stuff out of the output of the command and appending it in a file.

5条回答
  •  执念已碎
    2020-12-02 05:02

    grep $PATTERN * would be sufficient. By default, grep would skip all subdirectories. However, if you want to grep through them, grep -r $PATTERN * is the case.

提交回复
热议问题