What does “wget -O” mean?

后端 未结 4 1577
长情又很酷
长情又很酷 2020-12-23 13:51

I have an wget command like this in my shell script:

reponse=\"`wget -O- http:localhost:8080/app/index.html`\"

I don\'t understand the -O-

4条回答
  •  梦毁少年i
    2020-12-23 14:44

    Here's the man page of wget -O:

    http://www.gnu.org/software/wget/manual/html_node/Download-Options.html#Download-Options

    Here's a few examples:

    1. wget with no flag

      wget www.stackoverflow.com
      

      Output:

      A file named as index.html

    2. wget with -O flag

      wget -O filename.html www.stackoverflow.com
      

      Output:

      A file named as filename.html

    3. wget with -O- flag

      wget -O- www.stackoverflow.com
      

      Output:

      Output to stdout

提交回复
热议问题