Sunday, February 25, 2024

> /dev/null 2>&1 to prevent errors

> /dev/null : Redirects standard output to /dev/null, discarding it.

2>&1 : Redirects standard error to the same location as standard output. This ensures that both
standard output and standard error are discarded.

script.sh > script.log 2>&1


to prevent errors :-
command or script > /dev/null 2>&1

No comments:

Post a Comment

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...