linux下2个检查tcp连接的命令 Linux

1 检测web服务器的链接数量及状态:netstat -ant|awk '{print $5 "t" $6}'|grep "::ffff:"|sed -e 's/::ffff://' -e 's/:[0-9]*//' |sort|uniq -c| sort -rn|head -10结果:122 125.
标签: linux

发布于  2024-3-2 16:43

linux awk高级应用实例 Linux

今天看到unix shell 范例精解上有道awk的题目 做了以后拿来和大家分享下处理前的文档: Mike Harrington:(510) 548-1278:250:100:175 Christian Dobbins:(408) 538-2358:155
标签: linux

发布于  2024-3-2 16:43

linux shell实现求一个多维数组中的最大和最小值 Linux

同事发了一道shell题,是求一个多维数组中的最大和最小值如文件 99file: 33 55 23 56 99234 234 545 6546 3411 43 534 3
标签: linux

发布于  2024-3-2 16:43

一个监控网卡流量的shell脚本 Linux

实现代码:#!/bin/basheth_in_old=$(ifconfig eth0|grep "RX bytes"|sed 's/RX bytes://'|awk '{print $1}')eth_out_old=$(ifconfig eth0|grep "RX bytes"|sed 's/.*TX bytes://'|awk '{print $1}'
标签: linux

发布于  2024-3-2 16:43

自动化下载并检测ftp文件备份的shell脚本 Linux

实现代码:#!/bin/bash#ftime0=$(ll /root/hbshell/down.txt | awk '{print $7}')#ftime1=$(ll /root/hbshell/down.txt | awk '{print $7}')touch /root/hbshell/down.txt while :doif [[
标签: linux

发布于  2024-3-2 16:43

linux shell实现转换输入日期的格式 Linux

对于用户输入日期的合法性检验,是个很重要的问题,这个例子是简单得取得用户输入的日期,并转换为相应的格式,但不完美,原因请看后文。#!
标签: linux

发布于  2024-3-2 16:43

用来检测输入的选项$1是否在PATH中的shell脚本 Linux

今天无意中发现一本挺有意思的shell编程的书,是e文的,内容是101个shell案例,坚持明天看一个,写点心得。下面是例子001:#!/bin/sh# inpath - Verifi
标签: linux

发布于  2024-3-2 16:43

验证用户输入的参数合法性的shell脚本 Linux

今天这个例子是 用来验证用户输入的参数的合法性的,程序并不复杂,如下所示:#!/bin/sh# validAlphaNum - Ensures that input consists only of alphabetical# and
标签: linux

发布于  2024-3-2 16:43

对用户输入的判断的shell实现代码 Linux

今天的案例是将 对用户输入的判断的#!/bin/sh# validint -- Validates integer input, allowing negative ints too.function validint{ # Validate first field. Then test against
标签: linux

发布于  2024-3-2 16:43

shell脚本nicenumber实现代码 Linux

Given a number, shows it in comma-separated form.Expects DD and TD to be instantiated. Instantiates nicenum. or, if a second arg is specified, the output is echoed to stdout.废话不多说,首先
标签: linux

发布于  2024-3-2 16:43