Redirect output from terminal

i make a shell script. There has a line wget

https://cisofy.com/files/lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gz

When this line execute terminal show some text like this

Resolving cisofy.com (cisofy.com)... 149.*.*.*
Connecting to cisofy.com (cisofy.com)|149.*.*.*|:4444... connected.
HTTP request sent, awaiting response... 200 OK
Length: 180493 (176K) [application/octet-stream]
Saving to: `lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gz.1'

100%[======================================>] 180,493     56.5K/s   in 3.1s    

2015-05-13 03:46:43 (56.5 KB/s) - `lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gz.1' saved [180493/180493]

I want that the terminal don't show any text when the line execute. I tried

https://cisofy.com/files/lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gz | &> /dev/null

but it not work.:frowning:
Please help me :frowning:

From man wget :

       -q
       --quiet
           Turn off Wget's output.

If the line execution line was

 mv /root/Desktop/lynis/plugins/* /etc/lynis/plugins/

then i stop showing output by

-q
       --quiet

same system ?

There is not general rule-of-thumb in suppressing output many commands support a (-q or --quiet) option but many do not. check your on-line manual for the particular command and if no quiet option is available you may have to redirect standard out.

For example:

mv /root/Desktop/lynis/plugins/* /etc/lynis/plugins/ > /dev/null 2>&1

But think carefully what you want to happen in the case of an error (eg the plugins folder is empty, you run out of disk space, etc). If no one is around to see or act on the error perhaps it needs to be captured to a file and emailed to someone who can deal with it later on.

1 Like

&> /dev/null in post#1 if fine; just remove the pipe in front.