Lesson 1

Date: 1/22/2014
User accounts, files and directories, processes, system commands.
Linux for Engineering and IT Applications


Process data streams

  • Most of the Linux system processes have three data streams:
      standard input "0" (stdin)
      standard output "1" (stdo)
      standard error "2" (stderr)

  • The standard output and standard error are directed to the screen of your monitor; the standard input is read from a keyboard.

    It is possible to redirect the standard output and error into files, for example
    ps -ef 1 > stdo.out
    
    or
    ps -ef > stdo.out
    

    To redirect both stdo and stderr to the same file:
    command > output.txt 2>&1
    

    If you need to discard the stdo stream, you can re-direct it to /dev/null:
    ps -ef 1>/dev/null
    

    It is also possible to re-direct the standart output of one process into the standard input of the other using pipes "|"
    ps -ef | less
    



  • Take me to the Course Website