zoukankan      html  css  js  c++  java
  • Linux基础-命令查找命令

    locate -- 查找文件或者目录
    [root@localhost ssx-test]# locate /etc/passwd
    /etc/passwd
    /etc/passwd-

    搜索/etc目录下所有以pass开头的文件

    [root@localhost ssx-test]# locate /etc/pass
    /etc/passwd
    /etc/passwd-

    搜索/etc目录下所有以sh开头的文件

    [root@localhost ssx-test]# locate /etc/sh
    /etc/shadow
    /etc/shadow-
    /etc/shells

    搜索/etc目录下所有以sh开头的文件,忽略大小写

    [root@localhost ssx-test]# locate -i /etc/sh
    /etc/shadow
    /etc/shadow-
    /etc/shells

    [root@localhost ssx-test]# cd
    [root@localhost ~]# pwd
    /root
    [root@localhost ~]# ls
    anaconda-ks.cfg index.html ssx-test
    [root@localhost ~]# locate -i ~/ss
    /root/ssx-test
    /root/ssx-test/index-test.html
    [root@localhost ~]# locate index-test.html
    /root/ssx-test/index-test.html
    [root@localhost ~]#

    which -- 查找系统PATH环境变量目录下的命令(绝对路径)
    示例:which ls

    [root@localhost ~]# which ls
    alias ls='ls --color=auto'
    /usr/bin/ls
    [root@localhost ~]# rpm -qf /usr/bin/ls
    coreutils-8.22-21.el7.x86_64
    [root@localhost ~]#

    whereis
    -- 查找文件索引数据库下的命令/源文件/man文件.非PATH变量查找,所有查找的面比which要广.
    -- 只搜索二进制文件(参数-b)、man说明文件(参数-m)和源代码文件(参数-s)。如果省略参数,则返回所有信息。
    [root@localhost ~]# whereis ls
    ls: /usr/bin/ls /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz

  • 相关阅读:
    使用windows自带工具计算文件 MD5 值
    去除桌面图标的箭头
    给自己电脑(物理机)安装 linux 系统
    Python 字典 fromkeys()方法的坑
    Python 超时(运行时间太长) 自定义多长时间结束进程
    Win10 python2和python3共存
    verdidebussy的使用技巧
    <DC guide ---2>
    <DC guide ---1>
    <RTL To GDS ---第一阶段>
  • 原文地址:https://www.cnblogs.com/s-sx/p/11840408.html
Copyright © 2011-2022 走看看