linux 命令

1,跳板机登录服务器以后,一般进入 data 目录操作 sudo su - 可以切换到root权限建立文件夹
2,命令行
Ctrl+a 移动到当前行的开头
Ctrl+e 移动到当前行的结尾
history 查询历史命令
Ctrl+l 清屏
参考资料:https://www.jb51.net/article/109014.htm
3,查询主机IP ifconfig -a
4,uname -a 查看linux版本
hostname -i 查看主机IP
5,unzip slot_feauture_lr_statistics.zip 在当前目录下直接解压 产生slot_feauture_lr_statistics目录
6 ls -lh 查看文件大小 kb m G
7 ,du -h --max-depth=1 各个文件占用空间大小
du -h –max-depth=1 * 可以查看当前目录下各个文件或者文件的大小
8,du -sh 输出当前目录的总的大小
du -sh * 当前各个目录的大小
9,ls -alh
10 ,后台执行
nohup python xx.py >log.txt 2>&1 &
11,cd ./liukai 进入当前目录下的liukai目录
12,find -name liukai.txt 在服务器中查找liukai.txt
13, find /var -name test.file 指定目录查找 参考资料:https://blog.csdn.net/xxmonstor/article/details/80507769
14,find /etc -name '*srm*'  #使用通配符*(0或者任意多个)。表示在/etc目录下查找文件名中含有字符串‘srm’的文件
15 grep -E "word1|word2|word3" file.txt grep 匹配多个关键词
16,如果你想在当前目录下 查找"hello,world!"字符串,可以这样:
grep -rn "hello,world!" *
* : 表示当前目录所有文件,也可以是某个文件名

-r 是递归查找
-l 只列出文件 不列出具体匹配行
-n 是显示行号

-R 查找所有文件包含子目录

-i 忽略大小写
参考资料https://www.cnblogs.com/jackduan/p/7155402.html,https://blog.csdn.net/wujiangwei567/article/details/73470102

posted @ 2021-06-29 10:32  刘凯_tju  阅读(53)  评论(0编辑  收藏  举报