使用grep检索不区分大小写
grep使用参数小写字母i来作为条件不区分大小写,例:
ucp@test2:[/tmp]cat test.txt
qwer
QWER
ABC
abc
ucp@test2:[/tmp]
ucp@test2:[/tmp]grep -i aBc test.txt
ABC
abc
ucp@test2:[/tmp]grep -i abc test.txt
ABC
abc
ucp@test2:[/tmp]grep -i ABC test.txt
ABC
abc
ucp@test2:[/tmp]
find命令使用小写字母i
例:
ucp@test2:[/tmp/test]find ./ -iname test.txt
./test.txt
./Test.txt
./TEST.txt
ucp@test2:[/tmp/test]
vi或者vim命令不区分大小写
使用时将要检索的字符串后加上\c,例:
qwer
QWER
ABC
abc
~
/a\c