zoukankan      html  css  js  c++  java
  • Linux忽略大小写的查找技巧(转)

    1.vim 中的查找

      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

      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

  • 相关阅读:
    Maximal Square
    Count Complete Tree Nodes
    Rectangle Area
    Implement Stack using Queues
    Basic Calculator
    Invert Binary Tree
    Summary Ranges
    Basic Calculator II
    Majority Element II
    Kth Smallest Element in a BST
  • 原文地址:https://www.cnblogs.com/qbmiller/p/3745517.html
Copyright © 2011-2022 走看看