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?

grep活用術

Last updated at Posted at 2025-02-15

たまにこういうケースがある

データがない部分を探したい
※データベース等にデータがある場合はいいんだけどね。。

今回の場合はgrepで
ddd=

aaa
bbb=123
ccc
ddd
aaa
bbb=123
ccc
ddd
aaa
bbb=123
ccc
ddd
aaa
bbb=123
ccc
ddd
aaa
bbb=123
ccc
ddd
aaa
bbb=123
ccc
ddd
aaa
bbb=
ccc
ddd

色々方法はあると思うけど

[root@centos8_1 ~]# grep  -rn "bbb=$" xya.txt
26:bbb=

正直イマイチ。

いい方法を教えてもらったので早速記載します

grep の「x」オプション。完全一致に使える!

grep  -rnx "bbb=" xya.txt

0
0
1

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?