Is it possible to run this script in a kind of 'silent' mode, so that only the echo's are displayed? All the other output should be stored in a log file.#!/bin/shwhich docker && docker --version | grep Docker versionif [ $? -eq 0 ]then    echo already existingelse    sudo apt-get update && sudo apt-get upgrade -y    apt-cache policy docker-engine    sudo apt-get install -y \        linux-image-extra-$(uname -r) \        linux-image-extra-virtual \        docker-engine    sudo service docker start    which docker && docker --version | grep Docker version    if [ $? -eq 0 ]    then        echo installed correctly    else        echo installation failed >&2    fifi
Run shell script without showing all logs
shell script
Yes, you can if you change some lines:#!/bin/shwhich docker && docker --version | grep -q Docker versionif [ $? -eq 0 ]then    echo already existingelse    sudo apt-get update && sudo apt-get upgrade -y 2>&1 >something.log    apt-cache policy docker-engine 2>&1 >something.log    sudo apt-get install -y \        linux-image-extra-$(uname -r) \        linux-image-extra-virtual \        docker-engine 2>&1 >something.log    sudo service docker start 2>&1 >something.log    which docker && docker --version | grep -q Docker version    if [ $? -eq 0 ]    then        echo installed correctly    else        echo installation failed >&2    fifi