find
* 匹配任意个数的任意字符
?匹配1个任意字符
查找当前文件夹所以文件,显示包含‘pro’关键词的行及行号
find . -name '*' | xargs grep 'pro' -n
查找当前文件夹以.c结尾的所以文件,显示包含‘pro’关键词的行及行号
find . -name '*.c' | xargs grep 'pro' -n
查找当前文件夹下所有的文件,ls -lt 按照最近修改的时间,最近的在前面,
-print0 把find的每一个结果以null分割 ( 默认\n分割 ) , xargs -0 按 null 读取参数 ( 默认空格和\n )
防止文件夹名称中有空格!!!
find . -type f -print0 | xargs -0 ls -lt
vim 定位内容
gg 跳到文件开头
G 跳到文件末尾
/ 进入查找模式
n 查找下一个
shift + n 查找上一个
50gg 定位到第50行
用vim打开 foobar.sh 并将光标定位到done
vim +/done foobar.sh
vim
:set nu 显示行号
:set nonu 取消显示行号
rsync
rsync -avz -e "C:\cygwin64\bin\ssh.exe -i C:\Users\SysAdmin/.ssh/id_rsa" "FormatFactory" root@192.168.56.138:/root
reference:
https://sysadminote.com/how-to-use-rsync-from-windows-to-linux/
https://www.bilibili.com/video/BV1JT4y1F7Y1