To hide the progress bar output when using the curl command in a Linux/Unix shell script, you can use the -s
or --silent
option. This will make the curl command run in silent mode, which means that it will not display any progress information or error messages. (Diazepam)
For example, if you want to download a file from a URL, you can use the following command:
curl -s -o file.txt http://example.com/file.txt
The -o file.txt
option tells curl to save the output to a file named file.txt, and the -s
option makes it run in silent mode.
You can also use -S
, --show-error
instead of -s
, it will show error message only
Alternatively, you can redirect the output of the curl command to the /dev/null
file, which discards all data written to it.
curl -o file.txt http://example.com/file.txt > /dev/null 2>&1
This will download the file and output nothing on the console.