上一页 1 ··· 9 10 11 12 13 14 下一页
摘要: 按照行模式处理数据 ####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 阅读(46) 评论(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 阅读(88) 评论(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 阅读(162) 评论(0) 推荐(0) 编辑
摘要: which command which ls alias ls='ls --color=auto' /usr/bin/ls 阅读全文
posted @ 2021-02-27 09:34 老夫聊发少年狂88 阅读(42) 评论(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 阅读(53) 评论(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 阅读(49) 评论(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 阅读(148) 评论(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 阅读(46) 评论(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 阅读(28) 评论(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 阅读(58) 评论(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 阅读(46) 评论(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 阅读(80) 评论(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 阅读(54) 评论(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 阅读(79) 评论(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 阅读(45) 评论(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 阅读(48) 评论(0) 推荐(0) 编辑
摘要: cd 回到家目录 cd ~ 回到家目录 cd . 回到当前目录 cd .. 回到上级目录 cd - 回到上一次所在的目录 阅读全文
posted @ 2021-02-26 11:25 老夫聊发少年狂88 阅读(50) 评论(0) 推荐(0) 编辑
摘要: #####1 . ..代表什么 . 代表当前目录 .. 代表上级目录 #####从根/开始的路径是'绝对路径' [root@rongbiz002 ~]# cd /etc/skel/ #####从当前位置开始的目录为'相对路径' [root@rongbiz002 /]# cd etc/skel/ 阅读全文
posted @ 2021-02-26 11:09 老夫聊发少年狂88 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 通过bash shell对文件进行管理 就是 增 删 改 查 系统目录结构 几乎所有的操作系统都会通过目录结构来组织文件 具体来说就是一个目录里面存放子目录及文件 成树状 ######bin目录 普通用户的执行的命令 [root@rstx-53 /]# which ls /usr/bin/ls ## 阅读全文
posted @ 2021-02-25 15:24 老夫聊发少年狂88 阅读(68) 评论(0) 推荐(0) 编辑
摘要: #####1 命令补全 ps: tab键可以实现命令还有参数及路径补全 加快命令输入速度 还有减少路径输入错误带来的麻烦 安装tab补全工具 yum install bash-completion Loaded plugins: fastestmirror Loading mirror speeds 阅读全文
posted @ 2021-02-25 14:57 老夫聊发少年狂88 阅读(75) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 下一页