Linux 没有日志文件的 WGET

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3778908/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 23:15:40  来源:igfitidea点击:

WGET without the log file

linuxwget

提问by Joel

Every time I use wget http://www.domain.coma Log file is being saved automatically on my server. is there anyway to run this command without logging?

每次我使用 wget http://www.domain.com 时,都会在我的服务器上自动保存一个日志文件。有没有办法在不记录的情况下运行这个命令?

Thanks,

谢谢,

Joel

乔尔

采纳答案by Paul Rubel

You could try -o and -q

你可以试试 -o 和 -q

-o logfile
   --output-file=logfile
       Log all messages to logfile.  The messages are  
       normally reported to standard error.
-q
 --quiet
     Turn off Wget's output.

So you'd have:

所以你会有:

wget ... -q -o /dev/null ...

回答by Alberto Zaccagni

This will print the site contents to the standard output, is this what you mean when you say that you don't want logging to a file?

这会将站点内容打印到标准输出,这就是您说不想登录到文件时的意思吗?

wget -O - http://www.domain.com/

回答by MackieeE

I personally found that @Paul's answer was still adding to a Log file, regardless of the Command line output of -q

我个人发现@Paul 的回答仍然添加到日志文件中,无论命令行输出如何 -q

Added -Oto /dev/nullontop of the -ooutput file argument.

添加-O到输出文件参数的/dev/null顶部-o

wget [url] -q -o /dev/null -O &> /dev/null