2.23/2.24/2.25 find 命令
which 搜索文件及文件别名, 命令为 #which ls
where 根据库找, 要更新, 有局限性 #whereis ls
locate 模糊搜索, 不精准 #locate ls
安装 locate, 命令为 #yum install -y mlocate
依赖数据库文件 / var/lib/mlocate/mlocate.db, 这个文件每天凌晨 4 点生成更新;
手动生成, 命令为 #updatedb
清屏 ctrl+l, 退出 ctrl+d, 不执行或中断 ctrl+c, 光标前字符删除 ctrl+u, 光标移到字符最后 ctrl+e, 光标移到开头 ctrl+a;
find, 搜索文件,
搜索文件, 指定目录下, 指定文件名, 命令为 #find /etc/ -name "sshd_config"
搜索文件, 指定目录下, 指定模糊文件名,* , 命令为# find /etc/ -name "sshd*"
搜索文件, 指定目录下, 指定模糊目录, 命令为# find /etc/ -type d -name "sshd*"
type 类型, d 目录, f 文件, l 链接文件, s socket 文件, b 块设备,
find 命令格式,#find 目录 -type -name -mtime -ctime -atime
显示文件详细时间 #stat 文件名
访问时间 access atime, 权限更改时间 modify mtime, 修改内容时间 change ctime
-1 减一, 一天以内更改权限;+1, 大于一天,#find / -type f -mtime -1
一小时以内文件, min 分钟,#find / -type f -mmin -60
一小时以内文件, 找到后详细列出文件,#find / -type f -mmin -60 -exec ls -l {} \;
一小时以内文件, 找到后文件重命名,#find / -type f -mmin -60 -exec mv {} {}.bak \;
或者 - o,o 为 or , 例如 ##find / -type f -o -mtime -1 -o -name "*.conf"
-size 文件大小,-10k 小于 10k,+10k 大于 10k, +10M 大于 10 兆;
find 找硬链接文件,
查看 inode 号,#ls -i 1_heard.txt
依 inode 号找硬链接文件,#find / -inum 33583395
2.26 文件名后缀
文件名后缀不严谨, 可以自定义;
约定, txt 文本, log 日志, gz 压缩文件, conf 配置文件,
date 时间
LANG 语言
查看语言,#echo $LANG
2.27linux 和 windows 互相传文件
用 xshell 软件
#yum install -y lrzsz
linux 传到 windows, 命令为 #sz a.txt 按提示保存到 windows
windows 传到 linux, 命令为 #rz 选择 windows 文件, 之后保存到当前目录
来源: http://www.bubuko.com/infodetail-2485272.html