Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
linux:pipe [2018/03/20 15:49] – [Pipe to a file] tmadelinux:pipe [2019/06/05 11:40] – [Pipe to a file] tmade
Line 7: Line 7:
 ==== Pipe to a file ==== ==== Pipe to a file ====
  
-  (stdin)  0     #Standart input          +  (stdin)  0     #Standard input          
-  (stdout) 1     #Standart output         +  (stdout) 1     #Standard output         
-  (stderr) 2     #Standart error output+  (stderr) 2     #Standard error output
  
-  >              #redirects standart input +  >              #redirects standard input 
-  1>             #redirects standart output +  1>             #redirects standard output 
-  2>             #redirects standart error output+  2>             #redirects standard error output
  
 Examples: Examples:
  
-  ls /opt/ /otherfile > list 2>&         #Redirect standart output and standart error output to file +  ls /opt/ /otherfile > file 2>&         #Redirect standard error output and standard output and to "file
-  echo "This is a test" 1> /dev/null       #Redirects standart output to /dev/null+  ls /opt/ /otherfile > file 1>&         #Redirect standard output to    
 + 
 +  echo "This is a test" 1> /dev/null       #Redirects standard output to /dev/null
   ls xyz > info.txt 2> error.txt           #Output of ls will be redirected to "info.txt" (stdout) and if there is an error output (stderr) to "error.txt"   ls xyz > info.txt 2> error.txt           #Output of ls will be redirected to "info.txt" (stdout) and if there is an error output (stderr) to "error.txt"
   ls /opt /otherfolder 2> /dev/null        #Output Standartoutput - standarterroroutput will be piped to /dev/null   ls /opt /otherfolder 2> /dev/null        #Output Standartoutput - standarterroroutput will be piped to /dev/null
-  2> /opt/file                             #Redirects standart error output +  2> /opt/file                             #Redirects standard error output 
-  2>>  /opt/file                           #Redirects standart error output (appends)+  2>>  /opt/file                           #Redirects standard error output (appends)
      
 **Explication check:** **Explication check:**
  
   man -Len -Pless\ +/^REDIRECTION bash   man -Len -Pless\ +/^REDIRECTION bash
-   
 ==== Execution Dependency ==== ==== Execution Dependency ====
  
linux/pipe.txt · Last modified: 2022/02/16 04:34 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki