0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Linux】grepのちょっとした応用(?)

Posted at

▼使用場面

≪文字列1≫と≪文字列2≫の両方を含んだ行を取り出したいときに有効

▼構文

grep ≪文字列1≫ ≪ファイル名≫ | grep ≪文字列2≫

▼例

[root@localhost work]# cat test
大阪梅田
大阪淀屋橋
大阪心斎橋
大阪堂島
大阪難波
大阪高槻
[root@localhost work]# grep "大阪" test | grep "梅田"
大阪梅田
[root@localhost work]# grep "大阪" test | grep "堂島"
大阪堂島
[root@localhost work]#

まぁ応用でもなんでもないか。。。。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?