Home

Scripting. Running a command silently (silencing a command)

For example, to silence:

ssh-add ~/.ssh/my_key

Run:

ssh-add ~/.ssh/my_key >/dev/null 2>&1
  • >/dev/null: Redirects standard output (stdout) to /dev/null, effectively silencing it.
  • 2>&1: Redirects standard error (stderr) to the same place as standard output, also silencing any error messages.

Date:

Screen Dimensions