当前位置: 首页 > news >正文

网站建设一般用什么语言好免费软件不收费网站

网站建设一般用什么语言好,免费软件不收费网站,企业宣传册模板设计素材,百度建立企业网站建设的目的前言#xff1a; AWK是一种专门用于文本处理的编程语言#xff0c;它被广泛用于数据提取和报告生成#xff0c;也是企业笔试面试常考的内容#xff0c;以下34题是awk的用法案例#xff0c;希望可以帮到你#xff01; 1.查看TCP连接状态 [rootnode1 ~]# netstat -nat | a…前言 AWK是一种专门用于文本处理的编程语言它被广泛用于数据提取和报告生成也是企业笔试面试常考的内容以下34题是awk的用法案例希望可以帮到你 1.查看TCP连接状态 [rootnode1 ~]# netstat -nat | awk /^tcp/ {state[$NF]}; END {for(key in state) print state[key],key}| sort -nr 7 LISTEN 1 ESTABLISHED2.查找请求数20个IP常用于查找攻击源 [rootnode1 ~]# netstat -nalp|awk /^tcp/ {print $5}|awk -F: {print $1}| sort | uniq -c |sort -nr | head -n 20 4 3 0.0.0.01 192.168.110.13.输出当前系统所有用户的UID [rootshell ~]# awk -F: {print $3} /etc/passwd 注释-F指定分隔符为$3指定第三段4.输出当前系统所有用户的UID在首行加入UserUid [rootshell ~]# awk -F: BEGIN{print UserUid}{print $3} /etc/passwd5.输出当前系统shell为/bin/bash的用户名在最后一行加入END That is last line!!! [rootshell ~]# awk -F: $NF/bin/bash {print $1} END {print That is last line!!!} /etc/passwd root kxy fox That is last line!!! 6.输出当前系统上GID为0的用户的用户名 [rootshell ~]# awk -F: $40{print $1} /etc/passwd7.输出当前系统上GID大于500的用户的用户名 [rootshell ~]# awk -F: $4500{print $1} /etc/passwd8.输出当前系统上的所有用户名和UID以“ # # ”为分隔符 [rootshell ~]# awk -F: BEGIN{OFS # # } {print $1,$3} /etc/passwd [rootshell ~]# awk -F: -v OFS # # {print $1,$3} /etc/passwd9.输出/etc/passwd文件中以“”为分隔符的最后一段。 [rootshell ~]# awk -F: {print $NF} /etc/passwd10.对/etc/pa;sswd文件中输出的每一行计数 [rootshell ~]# awk {print NR,$0} /etc/passwd11.对/etc/passwd、/etc/fstab文件中输出的每一行分别计数。 [rootshell ~]# awk {print FNR $0} /etc/passwd /etc/fstab12.自定义变量 [rootshell ~]# awk -v varLinux.com.cn BEGIN{print var} Linux.com.cn13.以printf格式输出用户名UID、GID [rootshell ~]# awk -F: {printf %-19s %d %10i\n,$1,$3,$4} /etc/passwd14.检测当前系统上所有用户如果用户名为root输出Admin 如果用户名不为root输出Common User [rootshell ~]# awk -F: {if ($1root) printf %-19s: %s\n, $1,Admin; else printf %-19s: %s\n, $1, Common User} /etc/passwd15.统计当前系统上UID大于500的用户的个数 [rootshell ~]# awk -F: {if ($3500) sum} END {print sum} /etc/passwd16.读取/etc/passwd文件中的每一行的每一个字段输出每个字段中字符个数大于等于四的字段。 [rootshell ~]# awk -F: {i1;while (iNF) { if (length($i)4) {print $i}; i }} /etc/passwd17.使用do-while语句输出/etc/passwd中每一行中的前三个字段 [rootshell ~]# awk -F: {i1;do {print $i;i} while(i3)} /etc/passwd18.使用for语句输出/etc/passwd中每一行中的前三个字段 [rootshell ~]# awk -F: {for(i1;i3;i) print $i} /etc/passwd19.统计/etc/passwd文件中各种shell的个数 [rootshell ~]# awk -F: $NF!~/^$/{BASHsum[$NF]}END{for(A in BASHsum){printf %-15s:%i\n,A,BASHsum[A]}} /etc/passwd 注释$NF!~/^$/最后一个字段非空BASHsum[$NF]最后一个字段相同的加一20.显示当前系统上UID号为偶数的用户名和UID [rootshell ~] awk -F: {if($3%21) next;{printf %-19s%d\n,$1,$3}} /etc/passwd21.统计当前系统上以tcp协议工作的各端口的状态数 [rootshell ~]# netstat -ant | awk /^tcp/ {STATE[$NF]} END {for(a in STATE) print a, STATE[a]}22.输出/etc/passwd中的每一行以||||隔开默认不换行 [rootshell ~]# awk -F: BEGIN{ORS||||}{print $0} /etc/passwd [rootshell ~]# awk -F: -v ORS|||| {print $0} /etc/passwd23.获取根分区剩余大小 [rootshell ~]# df -h | awk /\/$/ {print $4} 15G [rootshell ~]# df -h | awk $NF/ {print $4} 15G24.获取当前机器ip地址 [rootshell ~]# ip a | awk /ens33$/ {print $2} 192.168.110.132/2425.打印/etc/passwd中UID大于500的用户名和uid [rootshell ~]# awk -F: $3500 {print $1,$3} /etc/passwd nobody 65534 systemd-coredump 999 polkitd 998 colord 997 clevis 99626./etc/passwd 中匹配包含root或net或ucp的任意行 [rootshell ~]# awk -F: /root|net|ucp/ /etc/passwd root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin27.处理以下文件内容,将域名取出并根据域名进行计数排序处理(百度搜狐面试题) test.txt http://www.baidu.com/index.html http://www.baidu.com/1.html http://post.baidu.com/index.html http://mp3.baidu.com/index.html http://www.baidu.com/3.html http://post.baidu.com/2.html [rootshell ~]# cat test.txt http://www.baidu.com/index.html http://www.baidu.com/1.html http://post.baidu.com/index.html http://mp3.baidu.com/index.html http://www.baidu.com/3.html http://post.baidu.com/2.html [rootshell ~]# awk -F/ {print $3} test.txt | sort -nr | uniq -c3 www.baidu.com 2 post.baidu.com 1 mp3.baidu.com [rootshell ~]# awk -F/ {W[$3]} END {for (k in W) print W[k],k} test.txt | sort -nr 3 www.baidu.com 2 post.baidu.com 1 mp3.baidu.com28.请打印出/etc/passwd 第一个域并且在第一个域所有的内容前面加上“用户帐号 [rootshell ~]# awk -F: BEGIN{print 用户账号:}{print $1} /etc/passwd29.请打印出/etc/passwd 第三个域和第四个域 [rootshell ~]# awk -F: {printf %-5s %d\n, $3, $4} /etc/passwd30.请打印第一域并且打印头部信息为这个是系统用户打印尾部信息为:“” [rootshell ~]# awk -F: BEGIN {print 系统用户} {print $1} END {print } /etc/passwd31.请打印出第一域匹配daemon的信息. [rootshell ~]# awk -F: $1~/daemon/ /etc/passwd daemon:x:2:2:daemon:/sbin:/sbin/nologin32.请将/etc/passwd 中的root替换成gongda记住是临时替换输出屏幕看到效果即可 [rootshell ~]# sed s/root/gongda/g /etc/passwd [rootnode1 ~]# awk {gsub(/root/, gongda); print} /etc/passwd33.请匹配passwd最后一段域bash结尾的信息有多少条 [rootshell ~]# awk /bash$/ passwd | wc -l 3 [rootshell ~]# awk { if ($NF~/bash$/) sum } END {print sum} /etc/passwd 334.请同时匹配passwd文件中带mail或bash的关键字的信息 [rootshell ~]# awk $0~/mail|bash/ passwd root:x:0:0:root:/root:/bin/bash mail:x:8:12:mail:/var/spool/mail:/sbin/nologin kxy:x:1000:1000:kxy:/home/kxy:/bin/bash fox:x:1001:1001::/home/fox:/bin/bash fox:x:1001:1001::/home/fox:/bin/mail
http://www.hkea.cn/news/14420296/

相关文章:

  • 上海企业建站 免费一般通过头发就能察觉到
  • 网站建设与网页设计课程设计网页设计需要考什么证书
  • 专门做外卖的网站如何在google上免费推广
  • seo 哪些媒体网站可以发新闻天眼查公司查询官网
  • 做网站价钱app开发app制作公司
  • 青岛建设厅网站wordpress sqlite
  • 打开网站建设中是什么意思自己做商城网站 哪种好
  • 做网站.服务器怎么买wordpress 小程序插件
  • 福州网站建设软件企业数字化服务平台
  • 地方网站发展注册建公司网站
  • 建设mylove卡网站wordpress获取菜单链接
  • 网站建设与微信公众号绑定法律行业网站建设
  • 如何查看网站ftp地址北京网站托管
  • 张家界建设局网站大型行业门户网站开发建设方案
  • 广西教育学会 网站建设建设网站对企业的重要性
  • 陕西省网站开发供需平台类网站建设
  • 网页制作与网站建设 在线作业网站建设入门pdf
  • qq代挂主站网站建设免费ppt模板大全下载的网站
  • 网站开发 超速云定制网站的制作流程
  • 深圳网站设计公司yx成都柚米科技15东莞工作招聘网最新招聘
  • 国家建设部网站官网证件查询网站如何做su
  • 网站后台 行间距调整微信长图的免费模板网站
  • 网站死链查询一站式手机网站制作
  • 北京营销型网站建站公司创维网站关键字优化
  • 建设电子商务网站前的市场分析wap网站自动
  • 运城市住房与城乡建设局网站网站系统怎么建设
  • 如何建造网站视频教程dz系统怎么做地方网站
  • MAC怎么做网站seo如何优化一个网站
  • 返利淘客网站源码和田哪里有做网站的地方
  • 网站div的高度根据图片做网站的空间和服务器吗