几个搜索命令(find),文件名后缀,linux和Windows之间传文件
来源:互联网 发布:淘宝食品没有证能吗 编辑:程序博客网 时间:2024/05/18 09:40
几个快捷键
Ctrl + l : 清屏
Ctrl + d : (行里没字符)退出一个终端,和exit ,logout 。(行内有字符)向后一个一个的删
Ctrl + c : 放弃这一行,进入下一行
Ctrl + u : 删除光标之前的字符
ctrl + e : 将光标移到行尾
Ctrl + a : 将光标移到行首
几个搜索命令
- which
搜索可执行文件的绝对路径
[root@shuai-01 ~]# which ls
- whereis
一种模糊查找,用的不多
[root@shuai-01 ~]# whereis ls locate
和whereis类似,模糊查找
要使用要先安装一个包mlocate
[root@shuai-01 ~]# yum -y install mlocatefind
find 命令语法:
find [路径] [参数]
[root@shuai-01 ~]# find /etc/ -name “ssh”
参数:
-name filename 查找该文件名的文件
[root@shuai-01 ~]# find /root -name "*.txt"/root/shuai/3.txt/root/deng/1.txt/root/1.txt/root/2.txt
-type filetype 通过文件类型查找文件(f,b,c,d,l,s)
[root@shuai-01 ~]# find /root/ -type l/root/deng/shuai
-atime 访问或执行时间
[root@shuai-01 ~]# find /tmp/ -atime -1/tmp//tmp/.Test-unix/tmp/.font-unix/tmp/.XIM-unix/tmp/.ICE-unix/tmp/.X11-unix/tmp/shuai/tmp/systemd-private-4d5410310bc44e4a8156c6025c03e487-vmtoolsd.service-mkXyBT/tmp/systemd-private-4d5410310bc44e4a8156c6025c03e487-vmtoolsd.service-mkXyBT/tmp
-ctime 文件大小,权限,iNode,写入时间
[root@shuai-01 ~]# find /tmp/ -ctime -1/tmp//tmp/.font-unix/tmp/.ICE-unix/tmp/.X11-unix/tmp/systemd-private-4d5410310bc44e4a8156c6025c03e487-vmtoolsd.service-mkXyBT/tmp/systemd-private-4d5410310bc44e4a8156c6025c03e487-vmtoolsd.service-mkXyBT/tmp
-mtime 写入时间
[root@shuai-01 ~]# find /tmp/ -mtime -1/tmp//tmp/systemd-private-4d5410310bc44e4a8156c6025c03e487-vmtoolsd.service-mkXyBT/tmp/systemd-private-4d5410310bc44e4a8156c6025c03e487-vmtoolsd.service-mkXyBT/tmp
如果几个参数以空格隔开,表示并列搜索
[root@shuai-01 ~]# find /etc/ -type f -atime -1 -mtime -1/etc/resolv.conf/etc/group/etc/gshadow/etc/tuned/active_profile
通过iNode号找硬链接
[root@shuai-01 ~]# ls -l总用量 12-rw-rw-r--. 2 root root 4 10月 25 23:58 1.txt-rw-rw-r--. 2 root root 4 10月 25 23:58 2.txt-rw-------. 1 root root 1422 10月 17 00:46 anaconda-ks.cfgdrwxrwxr-x. 2 root shuai 32 10月 26 22:19 dengdrwxrwxrwx. 4 root root 43 10月 24 21:19 shuai[root@shuai-01 ~]# ls -i 1.txt33574997 1.txt[root@shuai-01 ~]# find -inum 33574997./1.txt./2.txt
-mmin 查找多少分钟内改过的
[root@shuai-01 ~]# find /root/ -type f -mmin -60/root/1.txt/root/2.txt
-exec 找到的文件通过这个参数还能做一些其他的动作
找到60分钟内改过的文件的详细信息显示出来
[root@shuai-01 ~]# find /root/ -type f -mmin -60 -exec ls -l {} \;-rw-rw-r--. 2 root root 8 10月 27 23:53 /root/1.txt-rw-rw-r--. 2 root root 8 10月 27 23:53 /root/2.txt
找到60分钟内改过的文件并重命名
[root@shuai-01 ~]# find /root/ -type f -mmin -60 -exec mv {} {}.bak \;[root@shuai-01 ~]# ls1.txt.bak 2.txt.bak anaconda-ks.cfg deng shuai[root@shuai-01 ~]# find /root/ -name "*.bak"/root/1.txt.bak/root/2.txt.bak
stat命令
查看文件或目录详细信息,比ls -l 还要详细
[root@shuai-01 ~]# stat 2.txt 文件:"2.txt" 大小:4 块:8 IO 块:4096 普通文件设备:803h/2051d Inode:33574997 硬链接:2权限:(0664/-rw-rw-r--) Uid:( 0/ root) Gid:( 0/ root)环境:unconfined_u:object_r:admin_home_t:s0最近访问:2017-10-25 23:58:41.764965898 +0800最近更改:2017-10-25 23:58:37.392846746 +0800最近改动:2017-10-26 23:00:30.319973967 +0800创建时间:-
文件名后缀
linux下,文件后缀是没有什么特别要求的,但是为了便于区分,会习惯于把文本文件加.txt后缀,把shell文件加.sh后缀,而.gz,.zip , .gz2这些后缀通常表示压缩文件
linux 和Windows 传文件
在xshell下,可以做到。
先安装一个包(lrzsz),在linux
[root@shuai-01 ~]# yum install -y lrzsz
在linux下往Windows下传文件
[root@shuai-01 ~]# sz 1.txt
在Windows往linux下传东西
[root@shuai-01 ~]# rz
- 几个搜索命令(find),文件名后缀,linux和Windows之间传文件
- find命令、文件名后缀、Linux和windows互传文件
- L10 find命令和linux文件后缀
- find命令 、 文件名后缀
- linux学习第十篇:find命令,文件名后缀
- Linux搜索文件命令find
- Linux 文件搜索命令 find
- Linux文件搜索find命令
- Linux搜索文件命令find
- linux 文件搜索命令 find
- scp命令在linux和windows之间互传文件
- scp命令在linux和windows之间互传文件
- Linux学习之文件搜索命令(一)find 命令
- Linux命令--文件搜索命令find
- find命令、 文件名后缀2.23-2.26
- linux常用命令3.1--文件搜索命令之find和其他文件搜索命令
- linux-find【递归搜索文件名】
- linux-find【递归搜索文件名】
- 猎豹继续布局工具内容分发,推出“猎豹信息流开放平台”
- vivo出席GTI论坛分享最新研发成果
- Hyperloop One 与印度政府已进入谈判期,年底前决定是否在印度建设超级高铁
- 微信公众平台“账号迁移”开启公测,暂不支持个人账号
- Facebook 拟在乌干达铺设 500 英里光纤网络
- 几个搜索命令(find),文件名后缀,linux和Windows之间传文件
- Spring MVC中使用Swagger生成API文档和完整项目示例Demo,swagger-server-api
- C语言基础练习8
- Oracle 游标使用全解
- 百度联手德甲 用人工智能推动体育IP生态建设
- vivo携手高通亮相MWC 双摄Hi-Fi旗舰引发行业围观
- 华为推“创新城市”:用基站为无人机进行无线充电
- 雷军谈手机行业正经历最困难的时候,小米“造芯片”要把握自己的命运
- anaconda 在linux(centos7) 下的安装(虚拟机离线情况下)