I am currently looking ways to suppress error command in Linux, in particular, the command cp
.
I do:
root@ubuntu:~$ cp /srv/ftp/201*/wha*/*.jj ~/.
cp: cannot stat `/srv/ftp/201*/wha*/*.jj': No such file or directory
How do I suppress the error message that gets printed on the screen? I.e., I don't want to see this error message in my monitor.
To suppress error output in bash
, append 2>/dev/null
to the end of your command. This redirects filehandle 2 (STDERR) to /dev/null
. There are similar constructs in other shells, though the specific construct may vary slightly.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments