output redirection in UNIX

Posted by Happy Mittal on Stack Overflow See other posts from Stack Overflow or by Happy Mittal
Published on 2010-04-15T08:47:52Z Indexed on 2010/04/15 8:53 UTC
Read the original article Hit count: 162

Filed under:
|

I am a beginner in UNIX. I am finding some difficulty in input/output redirection.

  1. ls -l >temp

    cat temp

    Here why temp file is shown in the list and moreover, it is showing 0 characters.

  2. wc temp >temp

    cat temp

    here output is 0 0 0 temp. Why lines, words, characters are 0.

Please help me to undestand this concept.

© Stack Overflow or respective owner

Related posts about redirection

Related posts about unix