Linux認證

當前位置 /首頁/IT認證/Linux認證/列表

Linux忽略大小寫查詢技巧

   中的查詢

Linux忽略大小寫查詢技巧

Linux 下 vim搜尋檔案內容時加上 c 引數可以忽略搜尋字元的`大小寫.

比如用vim 搜尋檔案中的 China 時

可用 :/chinac

  2. find 查詢

Linux使用find命令搜尋檔案時如果不清楚檔案的名稱中是否包含的大寫,你可以使用 -iname引數來忽略大小寫.

[root@Blinux test]# ll

總用量 0

-rw-rw-r-- 1 Blinux root 0 12月 16 07:42 China

[root@Blinux test]# find ./ -name china

[root@Blinux test]# find ./ -iname china

./China

   查詢

使用管道grep 匹配關鍵詞時如果需要忽略大小寫,你可以使用 -i 引數.

[root@Blinux test]# rpm -qa|grep virtualbox

[root@Blinux test]# rpm -qa|grep virtualbox -i

VirtualBox-3.1-3.1.0_55467_fedora12-1.i686

TAG標籤:查詢 大小寫 LINUX #