欢迎光临IT网Linux学习频道

当前位置: > shell编程 >
  • [shell编程] shell脚本实现文件中数字的递增排序 日期:2014-12-05 02:47:09 点击:73 好评:0

    本节分享的这段shell脚本,实现对数字的递增排序。 代码: #!/bin/bash # 对数字进行递增排序 file= echo -n 输入文件名称 : read file if [ ! -f $file ] then echo $file 不是一个文件 exit 1 fi sort -n $file...

  • [shell编程] mysql纯文本格式备份的shell脚本 日期:2014-12-05 02:42:43 点击:121 好评:0

    一段shell脚本,用于实现mysql的纯文本格式备份。 所谓的mysql纯文本格式数据,是在数据表中没有insert into这样的查询sql语句的存在,而只有类似如下: 123,xxx,xxx,xxx 123,xxx,xxx,xxx 123,xxx,xxx,xxx 123,xxx,xxx,xxx 的纯数据结构。 此种备份方式,可以...

  • [shell编程] 清除c语言代码中注释的shell脚本(sed) 日期:2014-12-05 02:41:08 点击:188 好评:0

    写了一段shell脚本,用来清除c代码中的注释,不敢独享,分享给大伙。 运行示例:Run this script as follows: cat file.c | ./script.sh 1,c代码示例 file.c: #includestdio.h /* This is a test program * Version 1.0 * */ int main(){ printf(This is a...

  • [shell编程] Linux下IPv6的iptables防火墙脚本 日期:2014-12-05 02:38:07 点击:180 好评:0

    分享一个可用于IPv6的iptables防火墙脚本,适用于 CentOS/Debian/RHEL/及其它 Linux 平台。 代码: #!/bin/bash # IPv6 iptables防火墙脚本 # -------- IPT6=/sbin/ip6tables # Interfaces PUB_IF=eth1 PUB_LO=lo0 PUB_VPN=eth0 # Custom chain names CHAINS...

  • [shell编程] shell脚本实例:iptables防护脚本 日期:2014-12-05 02:37:07 点击:119 好评:0

    shell结合iptables自动拒绝恶意连接ssh的方法及实现代码 本脚本实现: 1,增加自动释放被锁定的IP地址功能 2,增加自动执行时间,无需在任务计划中修改 3,不会频繁报警 调用方法: #nohup ./ssh 在后台不间断运行。 停止方法: #ps aux | grep ./ssh |grep -...

  • [shell编程] 结合iptables防止ssh暴力破解的shell 日期:2014-12-05 02:36:12 点击:102 好评:0

    一个shell脚本,结合iptables实现防止ssh的暴力破解。 这段防止ssh暴力破解的脚本,不使用file2ban hostdeny pam_abl.so模块等软件,而是使用我们熟知的iptables。 代码: #!/bin/bsah # filename:ipt_ssh.sh # iptables防止ssh的暴力破解 # /sbin/iptables...

  • [shell编程] 二个iptables shell脚本(经典收藏) 日期:2014-12-05 02:34:45 点击:175 好评:0

    二个不错的iptables脚本,是学习iptables用法以及shell编程的好例子。 1,iptables脚本一 代码: #!/bin/sh # modprobe ipt_MASQUERADE modprobe ip_conntrack_ftp modprobe ip_nat_ftp iptables -F iptables -t nat -F iptables -X iptables -t nat -X #----...

  • [shell编程] iptables防止类CC攻击的shell脚本 日期:2014-12-05 02:34:03 点击:87 好评:0

    一段不错的shell脚本,用于防止CC攻击,有用到的朋友,研究下吧。 代码: #!/bin/bash #script info: # Analysis access_log.abc log for a certain period of time to visit the suffix: mp3, # and more than a certain number of requests an IP address,...

  • [shell编程] 在shell中判断iptables是否开启的方法 日期:2014-12-05 02:32:58 点击:60 好评:0

    如何用shell判断iptables服务是否开启呢? 问题:有如下的脚本,判断iptables是否开启,不知道是否正确? 代码: /sbin/service iptables status 1/dev/null 21 if [ $? -ne 0 ]; then _firewall_status=stopped fi 解答: 此脚本可以判断iptables服务是否开...

  • [shell编程] 管理iptables的shell脚本一例 日期:2014-12-05 02:31:39 点击:60 好评:0

    一个用于管理iptables的shell脚本,是学习iptables及shell编程的不错的例子。 注意: 由于启用了iptables防火墙,请注意下FTP的主被动模式。 FTP使用的是21端口,在进行FTP文件传输时,客户端首先连接到21端口,进行用户的认证,认证成功后,当要传输文件时,...

  • 首页
  • 上一页
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 下一页
  • 末页
  • 1431426
栏目列表
推荐内容