[toc]linux
快捷键: Ctrl + l :清屏 Ctrl + d :退出终端(至关于执行了:exit 或logout) Ctrl + c : 强制中断 Ctrl + u : 在命令输入行,删除光标前的字符串 Ctrl + e : 光标移到末尾 Ctrl + a : 光标移到开始
先介绍在Linux中经常使用的几个快捷键: Ctrl + l :清屏 Ctrl + d :退出终端(至关于执行了:exit 或logout) Ctrl + c :强制中断 Ctrl + u :在命令输入行,删除光标前的字符串 Ctrl + e :光标移到末尾 Ctrl + a :光标移到开始
用来定位指令的二进制程序、源代码文件和man手册页等相关文件的路径。windows
[root@xavi-001 ~]# yum install -y mlocate 已加载插件:fastestmirror, langpacks
[root@xavi-001 ~]# find /etc/ -name "sshd_config" /etc/ssh/sshd_config [root@xavi-001 ~]# find /etc/ -name "sshd*" /etc/ssh/sshd_config /etc/systemd/system/multi-user.target.wants/sshd.service /etc/sysconfig/sshd /etc/pam.d/sshd
[root@xavi-001 ~]# find /etc/ -type f -name "sshd*" /etc/ssh/sshd_config /etc/sysconfig/sshd /etc/pam.d/sshd
[root@xavi-001 ~]# find /etc/ -type l
[root@xavi-001 ~]# find /dev/ -type b /dev/sr0 /dev/sda3 /dev/sda2 /dev/sda1 /dev/sda
举例:bash
[root@xavi-001 ~]# find /etc/ -type f -mtime -1 /etc/resolv.conf /etc/tuned/active_profile
[root@xavi-001 ~]# find /etc/ -type f -ctime -1 -name "*.conf" /etc/resolv.conf
[root@xaviyunserver ~]# find /tmp/ -type f -o -mtime -1 -o -name "aliases" /tmp/ /tmp/bin /tmp/11.txt /tmp/123 /tmp/123/1.txt
[root@xavi-001 ~]# find /root/ -size +5k /root/.bash_history [root@xavi-001 ~]# find /root/ -size -5k /root/ /root/.bash_logout
[root@xavi-001 ~]# find /root/ -type f -size -10k -exec ls -lh {} \; -rw-r--r--. 1 root root 18 Dec 29 2013 /root/.bash_logout -rw-r--r--. 1 root root 176 Dec 29 2013 /root/.bash_profile -rw-r--r--. 1 root root 176 Dec 29 2013 /root/.bashrc -rw-r--r--. 1 root root 100 Dec 29 2013 /root/.cshrc -rw-r--r--. 1 root root 129 Dec 29 2013 /root/.tcshrc -rw-r--r--. 1 root root 1.7K Aug 9 00:17 /root/initial-setup-ks.cfg
.sh 脚本或批处理文件 .bz2 bzip2的压缩文件 .gz gzip的压缩文件 .tar tar打包文件 .tbz tar打包并用bzip压缩文件 .tgz tar打包并用gzip压缩的文件 .conf 配置文件 .lock LOCK文件(用来判断一个文件或设备是否被使用) .rpm REDHATPackage.Manager文件(套件包或软件包) .c C源程序代码文件 .cpp C++源程序代码文件 .h C或C++程序的头文件 .o 程序目标文件 .pl perl脚本文件 .so 类库文件
[root@xavi-001 ~]# LANG=zh_CN.utf-8 [root@xavi-001 ~]# stat 2.txt stat: 没法获取"2.txt" 的文件状态(stat): 没有那个文件或目录
[root@xavi-001 ~]# yum install -y lrzsz