linux shell 學習摘記(5)
《linux shell 指令碼程式設計攻略 (第2版)》 第五章 ”一團亂麻?沒有這回事“ 筆記
主要命令:
wget
,lynx
,curl
,圖片抓取指令碼
,網頁相簿生成指令碼
wget
wget -t 5 www.codeshold.me
,wget -t 0 www.codeshold.me
無限次嘗試,-O outfile.html
,-o out.log
- 可限速
--limit-rate 20k
, 可限制配額--quota 100m
或-Q 100m
- 斷點續傳
wget -c www.codeshold.me
- 映象整個網站
wget --mirror --convert-links www.codeshold.me
或者wget -r -N -k -l DEPTH URL
,其中-k
和--convert-links
指示wget將頁面的連結地址轉換為本地地址,-N
使用檔案的檔案戳 wget --user USERNAME --password PADDWD URL
wget http://10.108.255.249/cgi-bin/do_login --post-data "username=$name&password={TEXT}$pass&drop=0&type=1&n=100"i -q
lynx
curl
curl www.codeshold.me -o swf.html --progress
,--silent
不顯示進度資訊- 斷點續傳
curl URL/file -C offset
,curl -C -URL
(程式自己推斷出續傳的位置) - 參照頁(refer)可標誌使用者從哪個頁面到達當前頁面的,呈現的頁面可能會不一樣
curl --referer www.google.com www.codeshold.me
curl www.codeshold.me --cookie "user=wuzhimang;pass=mydream"
, 將cookie另存為一個檔案curl www.baidu.com --cookie-jar cookie.file
- 使用使用者代理(user agent),某些網站需特定的瀏覽器支援支援(如IE)
curl www.codeshold.me --user-agent "Mozilla/5.0"
使用者代理字串 - 新增頭部資訊
curl -H "Host: www.codeshold.me" -H "Accept-language: en" www.codeshold.me
- 限定
--limit-rate 20k
,--max-filesize bytes
- 認證
curl -u user:pass http://codeshold.me
,curl -u user http://10.108.255.249/
- 新增頭部
-I
或--head
- 命令列訪問Gmail (不能用的)此處有指令碼
POST請求
curl URL -d "XXX"
,wget URL --post-data "XXX" -O output.html
指令碼
相關文章
- linux shell 學習摘記(3)Linux
- linux shell 學習摘記(4)Linux
- linux shell 學習摘記(6)Linux
- linux shell 學習摘記(7)Linux
- linux shell 學習摘記(8)Linux
- linux shell 學習摘記(9)Linux
- linux shell 學習摘記(1)Linux
- linux shell 學習摘記(2)Linux
- Linux Shell 程式設計學習筆記Linux程式設計筆記
- shell學習筆記筆記
- 【Linux學習筆記29】shell指令碼基礎Linux筆記指令碼
- linux學習筆記-day5Linux筆記
- Linux學習筆記 Day 4~5Linux筆記
- 《Shell指令碼學習指南》學習筆記指令碼筆記
- Linux學習(Shell基礎)Linux
- Shell指令碼學習筆記指令碼筆記
- Shell 學習筆記 基礎筆記
- lftp學習備記錄--轉摘於網上FTP
- Linux學習-shell基礎02Linux
- Linux學習之(shell展開)Linux
- shell指令碼學習筆記-1指令碼筆記
- linux shell陣列深入學習理解Linux陣列
- Linux命令和shell指令碼學習Linux指令碼
- 前端學習 linux —— shell 程式設計前端Linux程式設計
- Linux Shell 學習資料推薦Linux
- Linux核心學習筆記(5)– 程式排程概述Linux筆記
- MongoDB 學習筆記之常用 shell 命令MongoDB筆記
- Shell學習筆記_時間計算筆記
- 如何學習shell程式設計?Linux運維學習shell程式設計是什麼程式設計Linux運維
- Vue學習筆記5Vue筆記
- git學習筆記5Git筆記
- CCNA學習筆記5筆記
- 什麼是shell指令碼?Linux為什麼學習shell?指令碼Linux
- 外語學習的書摘與思.5 - 高階:道於日常
- 強化學習-學習筆記5 | AlphaGo強化學習筆記Go
- 【學習】Linux Shell指令碼程式設計Linux指令碼程式設計
- Linux學習之路(三)Shell指令碼初探Linux指令碼
- Linux Bash Shell學習(十):流程控制——forLinux