linux命令行下wget下载ftp文件

wget -nH -m –ftp-user=user –ftp-password=passwd ftp://ipaddress/*
-nH不建立以IP为名的文件夹, -m是mirror镜像

shell批量获取百度及google收录与alexa排名

这个shell脚本查询百度收录及alexa排名没有包含google,google要多增加一个cook跟referer的资料,不然得不到页面..修改一下域名跟路径就可以用了~

  1. #!/bin/bash
  2. cd /root/get_google_baidu_site
  3. $(curl http://alexa.chinaz.com/?domain=baiqiuyi.com -o alexa.temp && cat alexa.temp |iconv -f gb2312 -t utf8|grep 综合排名|sed -e 's/<[^>]*>//g' -e 's/^[ \t]*//g' -e '2d' > today.result && rm alexa.temp)
  4. $(wget -q http://www.baidu.com/s?wd=site%3Abaiqiuyi.com -O baiqiuyi.temp)
  5. $(head -80 baiqiuyi.temp|iconv -f gb2312 -t utf8 > baiqiuyi.html && rm baiqiuyi.temp)
  6. curl -A "Mozilla/4.0(compatible; MSIE 6.0; Windows NT 5.0)" -e "www.google.cn" -D google.txt "http://www.google.cn/search?hl=zh-CN&q=site%3Abaiqiuyi.com&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f&oq="|sed -e 's/<[^>]*>//g' -re 's/.*(中国的网页 &nbsp;网页&nbsp;.*项符合 baiqiuyi\.com).*/\1/g;'|grep "中国的网页 &nbsp;网页&nbsp;约有"|sed -e 's/&nbsp;//g' -e 's/中国的网页 网页/baiqiuyi.com Google 一下/' -e 's/ baiqiuyi\.com//g' >> today.result
  7.    $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' baiqiuyi.html >> today.result|echo -e "\n\n" >>today.result && rm baiqiuyi.html)
  8. $(cat kof1.temp|iconv -f gb2312 -t utf8 > kof1.result && rm kof1.temp)
  9. $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' kof1.result >> today.result |echo -e "\n\n"$(date) >> today.result && rm kof1.result)
  10. clear
  11. cat /root/get_google_baidu_site/today.result && rm /root/get_google_baidu_site/today.result

得到的结果大概为这样:

  1. 网站 www.baiqiuyi.comAlexa 上综合排名第 210,313 位。
  2. baiqiuyi.com Google 一下约有 246 项符合
  3. 百度一下,找到相关网页197篇,用时0.001
  4.  
  5. Tue Apr 28 21:43:05 CST 2009

shell脚本查询百度收录及alexa排名

shell批量查询网站的排名及收录情况..多个网站依葫芦画瓢就可以,不是什么好东西,自己乱搞一通,为的就是方便.用到的工具有curl跟wget,把路径换成你自己的,就可以用了..

  1. #!/bin/bash
  2. cd /root/get_site_info
  3. $(curl http://alexa.chinaz.com/?domain=baiqiuyi.com -o alexa.temp && cat alexa.temp |iconv -f gb2312 -t utf8|grep 综合排名|sed -e 's/<[^>]*>//g' -e 's/^[ \t]*//g' -e 2d > today.result && rm alexa.temp)
  4. $(wget -q http://www.baidu.com/s?wd=site%3Abaiqiuyi.com -O baiqiuyi.temp)
  5. $(cat baiqiuyi.temp|iconv -f gb2312 -t utf8 -o baiqiuyi.html || rm baiqiuyi.temp)
  6. $(sed -e '/百度一下/!d' -e 's/<[^>]*>//g' -e 's/&nbsp;//g' -e '1,2d' baiqiuyi.html >> today.result && echo $(date) >> today.result && rm baiqiuyi.html)
  7. clear
  8. cat /root/get_site_info/today.result
  9. #wall <<EOF
  10. #search from web are Done!
  11. #EOF
1 1