zoukankan      html  css  js  c++  java
  • linux基础之find命令常用用法

    一、根据文件名查找文件

    • 1.在当前目录中根据文件名(完整文件名)查找文件(若是目录文件,则打印目录下所有文件)
      只是在当前目录查找,不会遍历当前目录下的目录文件
    #在当前目录查找1.c文件
    linux@ubuntu:~$ find 1.c
    1.c
    #在当前目录查找后缀为.txt的所有文件
    linux@ubuntu:~$ find *.txt
    testtest.txt
    test.txt
    #在当前目录查找以test开头的所有文件
    linux@ubuntu:~$ find test*
    test
    test/inc
    test/inc/match_bmp.h
    test/inc/touch.h
    test/inc/bmp.h
    test/bin
    test/bin/main
    test/src
    test/src/touch.c
    test/src/bmp.c
    test/src/match_bmp.c
    test/src/main.c
    test/Makefile
    testtest.txt
    test.txt
    
    • 2.查找指定目录下的文件
    #在当前目录下的test/src/目录查找后缀为“.c”的所有文件
    linux@ubuntu:~$ find test/src/ -name '*.c'
    test/src/touch.c
    test/src/bmp.c
    test/src/match_bmp.c
    test/src/main.c
    
    • 3.使用名称和忽略案例查找文件
    #在当前目录找到名称为test的所有文件,不区分大小写
    linux@ubuntu:~/test$ find ./ -iname test
    ./Test
    ./test
    
    • 4.使用名称查找.c文件
    #在当前工作目录中查找所有.c文件。
    linux@ubuntu:~/test$ find ./ -type f -name '*.c'
    ./src/touch.c
    ./src/bmp.c
    ./src/match_bmp.c
    ./src/main.c
    ./bmp.c
    
  • 相关阅读:
    windows端安装maven
    在Windows上安装Gradle
    beego快速入门
    centos7 下安装 nginx-1.12.2
    centos7安装mongodb
    浏览器缓存总结(cookie、localStorage、sessionStorage)
    面试题(2)
    跨域是什么,如何解决跨域
    函数节流与防抖
    元素水平垂直居中
  • 原文地址:https://www.cnblogs.com/risesource/p/12051120.html
Copyright © 2011-2022 走看看