1.esc退出编辑 ,i 进入编辑,: wq 退出保存
2.yy复制行, p粘贴
3.最末行G,开始行gg
4. mkdir rmdir 新建/删除 文件夹
5. rm -rf 删除文件
6. touch cp 新建文件,复制
7. cat more less
8. echo 输出
9. head tail 查看 head -n 5 hello.txt
10.监控文件的更新 tail -f
10. in 对应windows 的快捷键创建
ln -s 源文件 目标文件 -s 是 symbolic的意思。
例:ln -s /lib/lsb /usr/lj
即:在usr目录下建立指向/lib/lsb目录的lj文件。
12.history 查看历史指令 ,history 10 最近的10个指令
要执行指定序号的指令 !12,则执行 history看到的第12个指令
13.date, date “+%Y”,date -s ‘’
14.日历 cal 2020
11. find /home -name *.txt ,find find /home -user root
12. find /home -size -n ( +n大于, -n小于 n等于)
13. 使用locate查找,首先 updatedb, 然后locate *.txt
14. cat hello.txt | grep yes 在txt中找yes
15. grep 找所在行号 cat hello.txt | grep -n yes
16. grep 找所在行号 cat hello.txt | grep -ni yes 忽略yes的大小写
17. gzip hello.txt 压缩完不保留原文件
18. gunzip hello.txt 解压缩
19. zip -r mypackage.zip /home/ 把home下面的所有文件压缩到mypackage中, 递归压缩
20. unzip -d /home/use package.zip
21. 打包指令 tar -zcvf a.tar.gz a1.txt a2.txt
22. tar -zcvf a.tar.gz /home/
23.减压 tar -zxvf a.tar.gz
24.减压到指定目录 tar -zxvf a.tar.gz -C /home/ 指定的目录必须存在
Linux操作命令vim下
最新推荐文章于 2022-04-07 14:35:53 发布