摘要: [root@oldboy02 ~]# cat >person.txt<<EOF > 101,oldboy,CEO > 102,zhangyao,CTO > 103,Alex,C00 > 104,yy,CFO > 105,feixue,CTO > EOF root@oldboy02 ~]# mkdir 阅读全文
posted @ 2018-11-25 13:37 juncheng.yang 阅读(5180) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-11-25 13:36 juncheng.yang 阅读(134) 评论(0) 推荐(0) 编辑
摘要: [root@oldboy02 ~]# # awk 参数 '模式{动作}' 文件 [root@oldboy02 ~]# # awk 参数 '条件(找谁) {干啥}' 文件 [root@oldboy02 ~]# awk -F ":" 'NR==2{print $2,$4}' /etc/passwd x 阅读全文
posted @ 2018-11-25 13:32 juncheng.yang 阅读(591) 评论(0) 推荐(0) 编辑
摘要: [root@oldboy02 ~]# # awk 参数 '模式{动作}' 文件 [root@oldboy02 ~]# # awk 参数 '条件(找谁) {干啥}' 文件 [root@oldboy02 ~]# awk -F ":" 'NR==2{print $2,$4}' /etc/passwd x 阅读全文
posted @ 2018-11-25 13:31 juncheng.yang 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 案例1 awk 的匹配过滤功能 [root@oldboy02 ~]# awk 'BEGIN{h[110]="lee";h[114]="xo";print h[110],h[114]}' lee xo [root@oldboy02 oldboy]# vim url.txt http://www.eti 阅读全文
posted @ 2018-11-25 13:30 juncheng.yang 阅读(175) 评论(0) 推荐(0) 编辑
摘要: [root@oldboy02 scripts]# file /etc/init.d/iptables (file 主要是用来查看文件类型) /etc/init.d/iptables: POSIX shell script text executable [root@oldboy02 scripts] 阅读全文
posted @ 2018-11-25 13:29 juncheng.yang 阅读(247) 评论(0) 推荐(0) 编辑
摘要: [BEGIN] 2018/11/12 15:05:16 案列:每分钟显示当前系统的时间年-月 日_周和当前系统的IP地址,追加到/tmp/ip.log 中 [2018/11/12 15:09:16] [root@oldboy-200 ~]# date +%F_%w [2018/11/12 15:09 阅读全文
posted @ 2018-11-25 13:28 juncheng.yang 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 案例让一个命令在开机的时候自动运行的方法 [root@oldboy-200 ~]# vim /etc/init.d/oldboy [root@oldboy-200 ~]# cat /etc/init.d/oldboy # chkconfig: 2345 99 99 echo aaa(表示脚本的文件内 阅读全文
posted @ 2018-11-25 13:26 juncheng.yang 阅读(625) 评论(0) 推荐(0) 编辑