随笔分类 -  linux shell

上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 78 下一页
摘要:1、 [root@centos79 test]# cat a.txt a g r e u c j alike i x k like a f g liker a f h g liker s g e g [root@centos79 test]# grep "^a" a.txt ## 查找以a开头的行 阅读全文
posted @ 2021-07-04 19:37 小鲨鱼2018 阅读(9480) 评论(0) 推荐(0)
摘要:1、测试数据 [root@centos79 test]# ls a.txt [root@centos79 test]# cat a.txt a g e u c j alike i x k like w f g liker s g e g [root@centos79 test]# echo "b.t 阅读全文
posted @ 2021-07-04 19:18 小鲨鱼2018 阅读(960) 评论(0) 推荐(0)
摘要:1、测试数据 [root@centos79 test]# cat a.txt a g e u c j alike i x k like w f g liker s g e g [root@centos79 test]# grep like a.txt u c j alike i x k like w 阅读全文
posted @ 2021-07-04 18:57 小鲨鱼2018 阅读(690) 评论(0) 推荐(0)
摘要:linux系统中如何删除文件的最后几行 1、 [root@centos79 test]# cat a.txt a g e d c j i x a e i r x v b x e w [root@centos79 test]# head -n -2 a.txt a g e d c j i x a e 阅读全文
posted @ 2021-07-04 18:14 小鲨鱼2018 阅读(1015) 评论(0) 推荐(0)
摘要:1、linux系统中如何统计文件的行数 [root@centos79 test]# cat b.txt a g e d c j i x a [root@centos79 test]# wc -l b.txt 3 b.txt 2、 [root@centos79 test]# cat b.txt a g 阅读全文
posted @ 2021-07-04 17:58 小鲨鱼2018 阅读(1220) 评论(0) 推荐(0)
摘要:1、问题 [root@centos79 software]# dnf install R bash: dnf: command not found... 2、安装dnf [root@centos79 software]# yum install epel-release Loaded plugins 阅读全文
posted @ 2021-06-27 23:03 小鲨鱼2018 阅读(10030) 评论(0) 推荐(2)
摘要:1、默认情况下root不能登录ssh 2、修改ssh服务配置文件 root@ubuntu01:~/Desktop# whoami root root@ubuntu01:~/Desktop# vim /etc/ssh/sshd_config ………… # Authentication: #LoginG 阅读全文
posted @ 2021-06-27 12:34 小鲨鱼2018 阅读(112) 评论(0) 推荐(0)
摘要:1、查看当前主机名 root@liujiaxin01-virtual-machine:~/Desktop# hostname liujiaxin01-virtual-machine ##太长 2、修改主机名 root@liujiaxin01-virtual-machine:~/Desktop# wh 阅读全文
posted @ 2021-06-27 12:26 小鲨鱼2018 阅读(711) 评论(0) 推荐(0)
摘要:Ubuntu 20.04.2默认不能进行root登录 1、查看系统版本 liujiaxin01@liujiaxin01-virtual-machine:~/Desktop$ whoami liujiaxin01 liujiaxin01@liujiaxin01-virtual-machine:~/De 阅读全文
posted @ 2021-06-27 12:20 小鲨鱼2018 阅读(662) 评论(0) 推荐(0)
摘要:1、问题 (1)、传输工具 2、安装ssh服务 liujiaxin01@liujiaxin01-virtual-machine:~$ whoami liujiaxin01 liujiaxin01@liujiaxin01-virtual-machine:~$ sudo apt-get install 阅读全文
posted @ 2021-06-27 11:44 小鲨鱼2018 阅读(182) 评论(0) 推荐(0)
摘要:1、系统信息 liujiaxin01@liujiaxin01-virtual-machine:~/Desktop$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.0 阅读全文
posted @ 2021-06-27 11:33 小鲨鱼2018 阅读(1959) 评论(0) 推荐(0)
摘要:1、问题 [root@localhost ~]# systemctl restart network Failed to restart network.service: Unit network.service not found. 2、查看iP [root@localhost ~]# ifcon 阅读全文
posted @ 2021-06-26 13:59 小鲨鱼2018 阅读(2505) 评论(0) 推荐(0)
摘要:1、测试数据 [root@centos7 test]# cat a.txt 4 8 2 6 2、直接求和 [root@centos7 test]# awk '{sum += $1}END{print sum}' a.txt 20 3、累积求和 [root@centos7 test]# cat a.t 阅读全文
posted @ 2021-06-25 00:51 小鲨鱼2018 阅读(3782) 评论(0) 推荐(0)
摘要:1、创建测试文件: [root@centos7 test]# touch {a..f}.txt [root@centos7 test]# ls a.txt b.txt c.txt d.txt e.txt f.txt 2、删除b.txt文件以外的所有文件 method1: [root@centos7 阅读全文
posted @ 2021-06-25 00:06 小鲨鱼2018 阅读(452) 评论(0) 推荐(0)
摘要:以centos7.9为例。 1、 [root@centos7 test]# uname -a Linux centos7 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux 阅读全文
posted @ 2021-06-24 23:35 小鲨鱼2018 阅读(1628) 评论(0) 推荐(0)
摘要:1、创建5个测试数据文件 [root@centos7 test]# dd if=/dev/zero bs=1M count=100 of=a.txt [root@centos7 test]# dd if=/dev/zero bs=1M count=10 of=b.txt [root@centos7 阅读全文
posted @ 2021-06-24 23:26 小鲨鱼2018 阅读(1641) 评论(0) 推荐(0)
摘要:linux系统awk命令统计每一个用户进程占用的内存。 1、 [root@centos7 test2]# ps aux | awk 'NR != 1 {a[$1]+=$6} END{for(i in a) print i, a[i]}' geoclue 3096 rpc 104 rstudio+ 5 阅读全文
posted @ 2021-05-07 19:16 小鲨鱼2018 阅读(475) 评论(0) 推荐(0)
摘要:linux系统awk命令拆分文件。 1、 [root@centos7 test2]# ls file.txt [root@centos7 test2]# cat file.txt -rw-r--r-- 1 root 52457 Aug 10 2019 ngx_http.c -rw-r--r-- 1 阅读全文
posted @ 2021-05-07 18:58 小鲨鱼2018 阅读(622) 评论(0) 推荐(0)
摘要:1、测试数据 测试1 [root@centos7 test2]# cat a.txt 01 02 03 04 05 06 07 08 09 10 2、测试2 [root@centos7 test2]# cat a.txt 01 02 03 04 05 06 07 08 09 10 [root@cen 阅读全文
posted @ 2021-04-26 09:45 小鲨鱼2018 阅读(687) 评论(0) 推荐(0)
摘要:1、测试数据,测试1 [root@centos7 test2]# seq -f %02g 10 > a.txt [root@centos7 test2]# ls a.txt [root@centos7 test2]# cat a.txt 01 02 03 04 05 06 07 08 09 10 2 阅读全文
posted @ 2021-04-26 09:16 小鲨鱼2018 阅读(905) 评论(0) 推荐(0)

上一页 1 ··· 61 62 63 64 65 66 67 68 69 ··· 78 下一页