当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
Linux忽略大小写的查找技巧
发布时间:2010/10/31 18:57:08 来源:城市学习网 编辑:ziteng
  1.vim 中的查找
  Linux 下 vim搜索文件内容时加上 \c 参数可以忽略搜索字符的大小写.
  比如用vim 搜索文件中的 China 时
  可用 :/china\c
  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
  3.grep 查找
  使用管道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
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved