//雪花飘落特效 //右上角github跳转   

文章分类 -  shell_script

摘要:#linux中shell变量$#,$@,$0,$1,$2的含义解释: 变量说明: $$ Shell本身的PID(ProcessID) $! Shell最后运行的后台Process的PID $? 最后运行的命令的结束代码(返回值) $- 使用Set命令设定的Flag一览 $* 所有参数列表。如"$*" 阅读全文
posted @ 2021-09-16 13:36 农夫运维 阅读(1044) 评论(0) 推荐(0)
摘要:#!/bin/bash # By yansongwel@163.com # 检测系统端口脚本 # mongo mongo_ip=( 192.168.44.217 192.168.1.21 192.168.44.203 ) port=( 27017 80 ) for ip in ${mongo_ip[ 阅读全文
posted @ 2021-08-30 18:05 农夫运维 阅读(39) 评论(0) 推荐(0)
摘要:#!/bin/bash function getdir(){ for element in `ls $1` do dir_or_file=$1"/"$element if [ -d $dir_or_file ] then getdir $dir_or_file else echo $dir_or_f 阅读全文
posted @ 2021-08-05 09:11 农夫运维 阅读(440) 评论(0) 推荐(0)
摘要:1 文件{ ls -rtl # 按时间倒叙列出所有目录和文件 ll -rt touch file # 创建空白文件 rm -rf dirname # 不提示删除非空目录(-r:递归删除 -f强制) dos2unix # windows文本转linux文本 unix2dos # linux文本转win 阅读全文
posted @ 2021-06-08 16:57 农夫运维 阅读(347) 评论(0) 推荐(0)
摘要:检测两台服务器指定目录下的文件一致性 #!/bin/bash ##################################### #检测两台服务器指定目录下的文件一致性 ##################################### #通过对比两台服务器上文件的md5值,达到检测 阅读全文
posted @ 2021-04-21 10:56 农夫运维 阅读(962) 评论(0) 推荐(1)
摘要:[root@kunpeng1 update-hive]# cat schedule.sh #!/bin/bash echo " start 1 level hive table distcp " sh /root/qrj/to-leap/update-hive/hive-cp-update-part 阅读全文
posted @ 2020-10-15 11:45 农夫运维 阅读(138) 评论(0) 推荐(0)
摘要:1、命令:date 2、命令功能:date 可以用来显示或设定系统的日期与时间。 3、命令参数 -d<字符串>:显示字符串所指的日期与时间。字符串前后必须加上双引号; -s<字符串>:根据字符串来设置日期与时间。字符串前后必须加上双引号; -u:显示GMT; --help:在线帮助; --versi 阅读全文
posted @ 2020-10-13 10:53 农夫运维 阅读(513) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-10-10 18:50 农夫运维 阅读(9) 评论(0) 推荐(0)
摘要:nmap-ncat.x86_64版nc/ncat nc/ncat所做的就是在两台电脑之间建立链接并返回两个数据流,在这之后所能做的事就看你的想像力了。你能建立一个服务器,传输文件,与朋友聊天,传输流媒体或者用它作为其它协议的独立客户端。centos 7下安装ncyum install nmap-nc 阅读全文
posted @ 2020-09-03 12:04 农夫运维 阅读(400) 评论(0) 推荐(0)
摘要:命令替换 在bash中,$( )与` `(反引号)都是用来作命令替换的。命令替换与变量替换差不多,都是用来重组命令行的,先完成引号里的命令行,然后将其结果替换出来,再重组成新的命令行。 exp 1 [root@localhost ~]# echo today is $(date "+%Y-%m-%d 阅读全文
posted @ 2020-09-03 11:55 农夫运维 阅读(1752) 评论(0) 推荐(0)
摘要:0. shell 调试代码如下:sh -x somefile.sh在somefile.sh 文件里加上set+x set-x1. 用 && || 简化if else代码如下:gzip -t a.tar.gzif [[ 0 == $? ]]; then echo "good zip"else echo 阅读全文
posted @ 2019-03-07 09:51 农夫运维 阅读(251) 评论(0) 推荐(0)
摘要:#!/bin/bash ################################################ #备份当天的messages日志,删除昨天的备份文件v.01# ################################################ tar=/usr/bin/tar rm=/usr/bin/rm mes=/var/log/ today=messa... 阅读全文
posted @ 2018-11-05 09:35 农夫运维 阅读(114) 评论(0) 推荐(0)