I'm using Wget to make http requests to a fresh web server. I am doing this to warm the MySQL cache. I do not want to save the files after they are served.
wget -nv -do-not-save-file $url
Can I do something like -do-not-save-file
with wget?
I'm using Wget to make http requests to a fresh web server. I am doing this to warm the MySQL cache. I do not want to save the files after they are served.
wget -nv -do-not-save-file $url
Can I do something like -do-not-save-file
with wget?
Use
q
flag for quiet mode, and tellwget
to output to stdout withO-
(uppercase o) and redirect to/dev/null
to discard the output:wget -qO- $url &> /dev/null
>
redirects application output (to a file). if>
is preceded by ampersand, shell redirects all outputs (error and normal) to the file right of>
. If you don't specify ampersand, then only normal output is redirected.if file is
/dev/null
then all is discarded.This works as well, and simpler:
Curl does that by default without any parameters or flags, I would use it for your purposes:
Curl is more about streams and wget is more about copying sites based on this comparison.
You can use
-O-
(uppercase o) to redirect content to the stdout (standard output) or to a file (even special files like/dev/null
/dev/stderr
/dev/stdout
)Or:
Or: (same result as last command)