linux常用命令(九)

2026-03-13 01:16:40

1、which

[root@shell ~]# which ifconfig

/sbin/ifconfig

[root@shell ~]# which cp

alias cp='cp -i'

        /bin/cp

linux常用命令(九)

linux常用命令(九)

2、find 命令用来在指定目录下查找文件。

只介绍最常用的部份。

-mtime -2 表示最近2天改过的文件

-ctime -2 : 在最近2天内被修改过的文件

d: 目录

f:文件

-name name : 文件名称符合 name 的文件。

-size   +5k                查大于5k的文件

[root@shell ~]# find ./ -size +5k  

./.viminfo

./install.log.syslog

./.subversion/servers

./.subversion/config

./.bash_history

linux常用命令(九)

3、查找当前目录不是文件夹的文件

[root@shell ~]#  find ./ ! -type d  

./employess

./.cshrc

./pass.txt

./.ssh/known_hosts

linux常用命令(九)

4、find ./ -type d   -mtime -2   查找最近两天改过的文件夹

[root@shell ~]# mkdir 2019

[root@shell ~]# find ./ -type d -mtime -2

./

./2019

linux常用命令(九)

5、find ./ -empty            查找大小为0的文件

[root@shell ~]# find ./ -empty  

./2019

./.java/.userPrefs/.user.lock.root

linux常用命令(九)

6、find . -type f -perm 644 -exec ls -l {} \;    查找文件权限为644的文件

[root@shell ~]# find . -type f -perm 644 -exec ls -l {} \;

-rw-r--r--. 1 root root 195 Dec 30  2017 ./employess

-rw-r--r--. 1 root root 100 Sep 23  2004 ./.cshrc

linux常用命令(九)

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:23
  • 阅读量:109
  • 阅读量:120
  • 阅读量:175
  • 阅读量:153
  • 猜你喜欢