find path -option [ -print ] [ -exec -ok command ] {
} \;
例:
[[email protected] ~]# find /etc/ -name passwd ---查找/etc/下名为passwd的文件
/etc/passwd
/etc/pam.d/passwd
例1:
[[email protected] ~]# find /dev/ -type b --查找/dev/下块设备文件
/dev/dm-1
/dev/dm-0
/dev/sr0
/dev/sda2
/dev/sda1
/dev/sda
[[email protected] ~]# ls -l /dev/dm-1
brw-rw----. 1 root disk 253, 1 7月 26 15:14 /dev/dm-1
例2:
[[email protected] ~]# find /root -type d --查找/root下所有目录包含/root
/root
[[email protected] ~]# ll -d /root
dr-xr-x---. 2 root root 4096 7月 25 22:58 /root
例3:
[[email protected] ~]# find /dev/ -type c 查找/dev/下所有字符设备文件
/dev/vsock
/dev/vcsa6
[[email protected] ~]# ll -d /dev/vsock
crw-------. 1 root root 10, 56 7月 26 15:14 /dev/vsock
例4:
[[email protected] ~]# find / -type p 查找/下所有管道文件
/run/dmeventd-client
/run/dmeventd-server
[[email protected] ~]# ll -d /run/dmeventd-client
prw-------. 1 root root 0 7月 26 15:14 /run/dmeventd-client
例5:
[[email protected] ~]# find /usr/share/man/ -type l ---查找/usr/share/man/下所有符号链接的文件
/usr/share/man/man1/xzegrep.1.gz
/usr/share/man/man1/xzfgrep.1.gz
[[email protected] ~]# ll -d /usr/share/man/man1/xzegrep.1.gz
lrwxrwxrwx. 1 root root 11 2月 14 03:21 /usr/share/man/man1/xzegrep.1.gz -> xzgrep.1.gz
例6:
[[email protected] ~]# find /root -type f 查找/root/下所有普通文件
/root/test.txt
[[email protected] ~]# ll -d /root/test.txt
-rw-r--r--. 1 root root 11 7月 25 21:42 /root/test.txt
-size +容量 | -容量 #按容量大小查找
例1:
[[email protected] ~]# find /usr/src/ -size +1M 查找在/usr/src/下大于1M的文件
/usr/src/apache-tomcat-9.0.36.tar.gz
/usr/src/nginx-1.16.1/objs/nginx
/usr/src/nginx-1.16.0/objs/nginx
/usr/src/nginx-1.18.0/objs/nginx
[[email protected] ~]# du -sh /usr/src/apache-tomcat-9.0.36.tar.gz
11M /usr/src/apache-tomcat-9.0.36.tar.gz
例2:
[[email protected] ~]# find /usr/src/ -size +1M -size -15M 查找/usr/src/下大于1M小于15M的文件
/usr/src/apache-tomcat-9.0.36.tar.gz
-perm #按执行权限来查找;
例:
[[email protected] ~]# find /root/ -perm 644 -type f 查找/root/下权限为644并且是普通文件
/root/test1.sh
[[email protected] ~]# ll -d /root/test1.sh
-rw-r--r--. 1 root root 1161 7月 21 16:47 /root/test1.sh
提示:r=4,w=2,x=1
[[email protected] ~]# find / -user ys -group ys 查找/下所有数组属主为ys的文件或目录
/home/ys
[[email protected] ~]# ll -d /home/ys
drwx------. 3 ys ys 86 2月 14 04:09 /home/ys
-mtime -n +n #按文件更改时间来查找文件,-n指n天以内,+n指n天以前;
-atime -n +n #按文件访问时间来查找文件;
-ctime -n +n #按文件创建时间来查找文件;
[[email protected] ~]# find /root/ -mtime -1 ---查找/root下一天内更改过的文件或目录
/root/test.txt
[[email protected] ~]# stat /root/test.txt
文件:"/root/test.txt"
大小:11 块:8 IO 块:4096 普通文件
设备:fd00h/64768d Inode:33617265 硬链接:1
权限:(0644/-rw-r--r--) Uid:( 0/ root) Gid:( 0/ root)
环境:unconfined_u:object_r:admin_home_t:s0
最近访问:2020-07-25 21:42:27.038601276 +0800
最近更改:2020-07-25 21:42:22.116571971 +0800
最近改动:2020-07-25 21:42:22.116571971 +0800
创建时间:-
mmin -n +n #按文件更改时间来查找文件,-n指n分钟以内,+n指n分钟以前;
-amin -n +n #按文件访问时间来查找文件;
-cmin -n +n #按文件创建时间来查找文件;
例:
[[email protected] ~]# touch ys.txt
[[email protected] ~]# find /root -mmin -1 -type f 查找/root下更改时间在一分钟之内的普通文件
/root/ys.txt
[[email protected] ~]# stat /root/ys.txt
文件:"/root/ys.txt"
大小:0 块:0 IO 块:4096 普通空文件
设备:fd00h/64768d Inode:33582685 硬链接:1
权限:(0644/-rw-r--r--) Uid:( 0/ root) Gid:( 0/ root)
环境:unconfined_u:object_r:admin_home_t:s0
最近访问:2020-07-26 16:16:27.168400745 +0800
最近更改:2020-07-26 16:16:27.168400745 +0800
最近改动:2020-07-26 16:16:27.168400745 +0800
创建时间:-
###可以看得出来/root/ys.txt这个文件访问时间和更改和改动一样
[[email protected] ~]# echo aaa> ys.txt
[[email protected] ~]# stat /root/ys.txt
文件:"/root/ys.txt"
大小:4 块:8 IO 块:4096 普通文件
设备:fd00h/64768d Inode:33582685 硬链接:1
权限:(0644/-rw-r--r--) Uid:( 0/ root) Gid:( 0/ root)
环境:unconfined_u:object_r:admin_home_t:s0
最近访问:2020-07-26 16:16:27.168400745 +0800
最近更改:2020-07-26 16:20:35.109956774 +0800
最近改动:2020-07-26 16:20:35.109956774 +0800
创建时间:-
###现在就有变化了
[[email protected] ~]# find /root -amin -4 -type f 查看/root下访问时间是在4分钟之内的普通文件
可以看得出来没有差的出来
[[email protected] ~]# cat ys.txt 访问一下 /root/ys.txt这个文件
aaa
再次查找就出来了
[[email protected] ~]# find /root -amin -4 -type f
/root/ys.txt
[[email protected] ~]# find /root/ -name "*.txt" ---查找/root下以.txt结尾的文件
[[email protected] ~]# find /root -name "[a-Z]*" ---查找/root下以a-Z开头的文件或者目录
[[email protected] ~]# find /root/ -name "test*" ---查找/root下以test开头的文件
[[email protected] ~]# find /usr/ -type d ---查找/usr/下所有文件夹
[[email protected] ~]# find /usr/ ! -type d ---查找/usr/下所有非文件夹
[[email protected] ~]# find /usr/ -type d | xargs chmod -R 755 ---查找/usr/下的所有目录并设置为755权限
或者:
[[email protected] ~]# find /usr/ -type d -exec chmod -R 755 {}\;
[[email protected] ~]# find /data/ -size +1M #查文件大小大于1Mb的文件;
[[email protected] ~]# find /data/ -size 10M #查文件大小为10M的文件;
[[email protected] ~]# find /data/ -size -1M #查文件大小小于1Mb的文件;
#查找/data目录以.log结尾,30天以前的文件,大小大于10M并移动到/tmp目录;
[[email protected] ~]# find /data/ -name "*.log" -type f -mtime +30 -siz +10M -exec mv {} /tmp/ \;
#查找/data目录以.log结尾,文件大于10k的文件,同时cp到/tmp目录;
[[email protected] ~]# find /data/ -name "*.log" -type f -size 10k -exec cp -a {} /tmp/ \;
#查找/data目录以.txt结尾,文件大于10k的文件,权限为644并删除该文件;
[[email protected] ~]# find /data/ -name "*.txt" -type f -size +10k -perm 644 | xargs rm -rf
有几种变量:类中的成员变量 - 这些被称为字段方法或代码块中的变量 - 这些被称为局部变量方法声明中的变量 - 这些被称为参数Bicycle类使用以下代码行来定义其字段:public int cadence;public int gear;public int speed;声明由以下三个部分组成:零个或多个修饰符,如公共或私有的字段的类型该字段的名称该字段的名称。 在自行车的领域
Windows 下 PHP memcached扩展安装 图文教程
RNA-seq最新利器——全长转录组测序转载2016-07-20 09:48:501.三代测序技术PacBioSMRT Sequencing2005年以来,转录组测序和研究的主流是基于NGS,即所谓的二代测序技术,虽然二代测序技术极大地提高了测序通量,且能够发现novel的转录本,但是由于其先天的缺陷,测序读长只能达到几百个碱基(MiSeq可以达到PE300),在转录组结构分析方...
学习来源:React中文网址Reactreact是React库的入口。加载React的方式如下:通过<script>标签加载;ES6中:import React from ‘react’;ES5中:var React = require(‘react’);React.Component //React组件的基类,抽象基类;React.PureComponent //与...
CN-DBpedia介绍CN-DBpedia是由复旦大学知识工场实验室研发并维护的大规模通用领域结构化百科,其前身是复旦GDM中文知识图谱。CN-DBpedia主要从中文百科类网站(如百度百科、互动百科、中文维基百科等)的纯文本页面中提取信息,经过滤、融合、推断等操作后,最终形成高质量的结构化数据,供机器和人使用。CN-DBpedia自2015年12月份发布以来已经在问答机器人、智能玩具、智慧医疗、智慧软件等领域产生3.5亿次API调用量。DumpCN-DBpedia目前提供Dump数据
@EnableAutoConfiguration启动自动装载:使用了这个注解之后,所有引入的jar的starters都会被自动注入。这个类的设计就是为starter工作的。@RestController这个注解专门用于写RESTful的接口的,里面集成了@Controller和@ResponseBody注解。 @ResponseBody 这个注解会自动利用默认的Jackson将return的对象序
ajax图片上传,使用插件上传图片
《编程实现获取linux服务器cpu、内存和磁盘使用率》https://blog.csdn.net/wan_hust/article/details/32314701?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.control&spm=1001.2101.3001.4242废话不多说了,直接上代码:#pragma once#include <inttypes
反转一个单链表。示例:输入: 1->2->3->4->5->NULL输出: 5->4->3->2->1->NULL//此题有收获,注意returnValue 的作用(仅用于返回)public ListNode reverseList(ListNode head) { if(head == null) return nu...
问题一:Prescan2019.1在联合仿真时,运行程序后VisViewer无法显示画面。如图,左下角显示未激活。解决方法:在Prescan工作界面点击如图按钮,勾选Visualize in VisViewer即可。问题二:联合仿真使用Camera+BRS做目标检测或行人检测时,运行时BRS+Camera显示界面黑屏。如图。解决方法:在配置传感器时进行如下操作。打开Camera传...
BS结构的系统使用web浏览器展示并与外部设备发卡器通信,IE浏览器支持的ocx技术在google chrome浏览器,firefox等浏览器上不再支持,这就无法使用ocx技术做兼容所有浏览器的web系统.友我科技读写器云服务插件就是为了解决web浏览器与发卡器进行通信而设计的,不仅支持google chrome浏览器,还支持IE,Firefox等主流的浏览器,简单来说,他就是一个连接发卡...
获取经过高通打补丁的android 源代码网址:https://www.codeaurora.org/wiki/QAEP#Branch_Releaseshttps://www.codeaurora.org/xwiki/bin/QAEP/eclairhttps://www.codeaurora.org/xwiki/bin/QAEP/eclair_caramelhttps://www.codeauro...