博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
find命令 文件名后缀
阅读量:7048 次
发布时间:2019-06-28

本文共 1373 字,大约阅读时间需要 4 分钟。

2.23find命令(上)

  • 几个搜索文件的命令

    #which ls
    #whereis ls
    #locate //这个命令系统中没有//

  • 需要另外安装
    #yum install -y mlocate
    总结几个快捷键
    #ctrl l //把光标定位到第一行//
    #ctrl d //退出,相当于执行了exit //
    #ctrl c //直接换行,不执行命令//
    #ctrl u //把前面的东西全部删掉//
    #ctrl e //把光标定位到最后//
    #ctrl a //最光标定位到最前面//

搜索一个知道路径的文件sshd_config

#find /etc/ -name "sshd_config"
搜索一个sshd开头的文件
#find /etc/ -name "sshd"
指定目录搜索
#find /etc/ -type d -name "sshd
"
指定类型
#find /etc/ -type f -name "sshd"
软链接文件
#find /etc/ -type l -name "sshd
"
b文件
#find /dev/ -type b
c文件
#find /dev/ -type c

2.24find命令(中)

查看文件的具体信息
[user3@centos-01 ~]$ stat 2.txt
文件:"2.txt"
大小:6 块:0 IO 块:4096 目录
设备:803h/2051d Inode:758803 硬链接:2
权限:(0775/drwxrwxr-x) Uid:( 1003/ user3) Gid:( 1003/ user3)
环境:unconfined_u:object_r:user_home_t:s0
最近访问:2017-12-22 14:57:07.174656993 +0800
最近更改:2017-12-22 14:57:07.174656993 +0800
最近改动:2017-12-22 14:57:07.178656917 +0800
创建时间:-

改权限是ctime 改文件内容mtime

访问文件
#cat 2.txt

查找创建或者更改时间是一天以内的文件

#find / etc/ -type f mtime -1

2.25find命令(下)

查找一个文件的硬链接
 #find / -inum 33583395

查找一小时内更改过的文件

#find /root/ -type f -nmin -60

查找的同时把所有文件ls -l

#/root/ -type f -nmin -120 -exec ls -l {} \;

查找的同时把所有文件改名字

#/root/ -type f -nmin -120 -exec mv {} {} .bak \;

查找文件大小大于10K的

#find /root/ -size +10k
查找文件大小小于10K的
#find /root/ -size -10k
查找文件大小大于10M的(M要大写)
#find /root/ -size +10M

2.26文件名后缀

相同类型的文件定义相同的后缀名

查看时间

#date
查看语言
#echo $LANG

转载于:https://blog.51cto.com/13242922/2053596

你可能感兴趣的文章
Storm ack和fail机制再论
查看>>
android开机动画(bootanimation)
查看>>
【LeetCode】107. Binary Tree Level Order Traversal II (2 solutions)
查看>>
《微软的软件测试之道》读书笔记 之 结构测试技术
查看>>
oracle ITL(事务槽)的理解
查看>>
maven本地jar
查看>>
DIV+CSS IE6/IE7/IE8/FF兼容问题汇总
查看>>
ASP.NET中Session的个人浅谈
查看>>
数学图形之Kuen Surface
查看>>
发RTX通知
查看>>
读《C# 和 Java 的比较》有感
查看>>
魅族的“火爆”预定表示“呵呵呵”-不要怪我拆穿
查看>>
ESXi 5.5 解决 cannot edit the settings of virtual machines of version 10
查看>>
【BZOJ】3399: [Usaco2009 Mar]Sand Castle城堡(贪心)
查看>>
4、什么构成了我们Android应用程序?(七大件)
查看>>
【面试虐菜】—— 常用SQL语句
查看>>
EF中Database.SqlQuery
查看>>
MongoDB开发应用实战
查看>>
跟我一起写 Makefile(一)
查看>>
(转)FS_S5PC100平台上Linux Camera驱动开发详解(二)
查看>>