Standard error

From Linux Bash Shell Scripting Tutorial Wiki
Jump to navigation Jump to search

← Standard outputHomeEmpty file creation →

  • Standard error is the default error output device, which is used to write all system error messages.
  • It is denoted by two number (2).
  • Also known as stderr.
  • The default standard error device is the screen or monitor.
  • 2> is input redirection symbol and syntax is:
 command 2> errors.txt

For example, send find command errors to a file called fileerrors.txt, sothat you can review errors later on, enter:

find / -iname "*.conf" 2>fileerrors.txt
cat fileerrors.txt
Redirection of stderr
Redirection of stderr

← Standard outputHomeEmpty file creation →