摘要:
#####wc -l 统计行号 [root@rongbiz002 26]# wc -l /etc/passwd 30 /etc/passwd 阅读全文
posted @ 2021-02-27 13:44
老夫聊发少年狂88
阅读(69)
评论(0)
推荐(0)
摘要:
工作模式 逐行读取 awk 'BEGIN{print "hello"} {print "ok"} END {print "word"}' /etc/passwd BEGIN 读取文件之前做的操作 print ok 逐行读取文件 每一行打印一个ok END 读取文件之后做的操作 1 查 1.1)打印整 阅读全文
posted @ 2021-02-27 11:48
老夫聊发少年狂88
阅读(91)
评论(0)
推荐(0)
摘要:
######cut -d 指定分隔符 -f 指定列数 1,2,3 [root@rongbiz002 26]# awk '{print $1}' /www/wwwlogs/c2p.rongbiz.com-access_log|head -n5 |cut -d '.' -f 1,2,3 112.64.5 阅读全文
posted @ 2021-02-27 11:25
老夫聊发少年狂88
阅读(58)
评论(0)
推荐(0)
摘要:
按照行模式处理数据 ####1查 #####1.1)打印单行信息 [root@iZbp130bctfwzi3oasr6raZ conf.d]# sed -n '1p' /etc/passwd root:x:0:0:root:/root:/bin/bash #####1.2)打印连续多行信息 1-3 阅读全文
posted @ 2021-02-27 11:16
老夫聊发少年狂88
阅读(49)
评论(0)
推荐(0)
摘要:
uniq -c统计次数 [root@rongbiz002 26]# awk '{print $1}' /www/wwwlogs/c2p.rongbiz.com-access_log|sort |uniq -c|sort -k1rn|head 2709 112.64.53.246 2668 120.5 阅读全文
posted @ 2021-02-27 11:12
老夫聊发少年狂88
阅读(101)
评论(0)
推荐(0)
摘要:
######sort -t 指定分隔符 -k 指定那一列排序 [root@rongbiz002 ~]# awk '{print $1}' /www/wwwlogs/www.rongbiz.com-access_log |sort -t "." -k2|head 120.0.113.75 112.0. 阅读全文
posted @ 2021-02-27 10:09
老夫聊发少年狂88
阅读(197)
评论(0)
推荐(0)
摘要:
which command which ls alias ls='ls --color=auto' /usr/bin/ls 阅读全文
posted @ 2021-02-27 09:34
老夫聊发少年狂88
阅读(52)
评论(0)
推荐(0)
摘要:
curl -o 下载到某个目录 并重命名 curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 阅读全文
posted @ 2021-02-27 09:03
老夫聊发少年狂88
阅读(64)
评论(0)
推荐(0)
摘要:
下载软件 wget wget -O 把文件下载到某个目录 并重命名 wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo wget --limit-rate=100k 阅读全文
posted @ 2021-02-27 09:01
老夫聊发少年狂88
阅读(59)
评论(0)
推荐(0)
摘要:
#####根据内容过滤文本信息 #####grep [root@rstx-201 ~]# grep root /etc/passwd root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin 加上通配符^ 阅读全文
posted @ 2021-02-26 14:48
老夫聊发少年狂88
阅读(174)
评论(0)
推荐(0)
摘要:
######tail 查看文件的尾部信息 默认后10行 [root@rstx-53 test]# tail /etc/passwd openvpn:x:995:991:OpenVPN:/etc/openvpn:/sbin/nologin postgres:x:26:26:PostgreSQL Ser 阅读全文
posted @ 2021-02-26 14:40
老夫聊发少年狂88
阅读(55)
评论(0)
推荐(0)
摘要:
#####head 查看文件头部内容 默认前十行 [root@rstx-201 ~]# head /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbi 阅读全文
posted @ 2021-02-26 14:26
老夫聊发少年狂88
阅读(30)
评论(0)
推荐(0)
摘要:
######cat #查看文件内容 [root@rstx-53 test]# cat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbi 阅读全文
posted @ 2021-02-26 14:17
老夫聊发少年狂88
阅读(65)
评论(0)
推荐(0)
摘要:
rm 删除 remove #####绕过交互删除 -f [root@rstx-53 test]# rm file rm: remove regular empty file ‘file’? n [root@rstx-53 test]# fm -f file -bash: fm: command no 阅读全文
posted @ 2021-02-26 14:09
老夫聊发少年狂88
阅读(53)
评论(0)
推荐(0)
摘要:
移动文件和目录 ######改名 [root@rstx-53 test]# mv file.txt /tmp/file_txt [root@rstx-53 test]# ls [root@rstx-53 test]# ll /tmp/file_txt -rw-r--r-- 1 yangtao yan 阅读全文
posted @ 2021-02-26 13:47
老夫聊发少年狂88
阅读(89)
评论(0)
推荐(0)
摘要:
cp 复制 copy ######复制文件 -v显示过程 [root@rstx-53 test]# touch file.txt [root@rstx-53 test]# cp file.txt /tmp/file_copy [root@rstx-53 test]# ll /tmp/file_cop 阅读全文
posted @ 2021-02-26 13:35
老夫聊发少年狂88
阅读(63)
评论(0)
推荐(0)
摘要:
#####以树状的结构显示目录和文件 [root@rstx-201 ~]# tree . ├── anaconda-ks.cfg ├── test └── test2 ├── 1 └── 2 4 directories, 1 file #显示文件和目录的数量 ######tail -L 查看目录层数 阅读全文
posted @ 2021-02-26 13:12
老夫聊发少年狂88
阅读(88)
评论(0)
推荐(0)
摘要:
#####mkdir make directory 选项 -v 显示创建详情 -p 递归创建 [root@rstx-201 ~]# mkdir test/test/test -vp mkdir: created directory ‘test’ mkdir: created directory ‘t 阅读全文
posted @ 2021-02-26 11:48
老夫聊发少年狂88
阅读(55)
评论(0)
推荐(0)
摘要:
#####touch 创建文件 ######touch file 无则创建 有责修改创建时间 [root@rstx-201 ~]# touch file [root@rstx-201 ~]# ll -rw-r--r-- 1 root root 0 Feb 25 22:28 file [root@rs 阅读全文
posted @ 2021-02-26 11:40
老夫聊发少年狂88
阅读(56)
评论(0)
推荐(0)
摘要:
cd 回到家目录 cd ~ 回到家目录 cd . 回到当前目录 cd .. 回到上级目录 cd - 回到上一次所在的目录 阅读全文
posted @ 2021-02-26 11:25
老夫聊发少年狂88
阅读(58)
评论(0)
推荐(0)
浙公网安备 33010602011771号