Changes

Jump to: navigation, search

Tutorial5: Redirection

53 bytes added, 09:43, 17 January 2021
Redirection (Standard Input, Standard Output, Standard Error)
<span style="font-family:courier;font-weight:bold">PWD<br>PWD 2> error-message.txt<br>PWD 2 >> error-messages.txt<br>PWD 2> /dev/null</span>
 
===The /dev/null File===
 
The '''/dev/null''' file (sometimes called the '''bit bucket''' or '''black hole''') is a special system file<br>that '''discard''' all data written into it. This is useful to discard unwanted command output.
<span style="font-family:courier;font-weight:bold;">LS 2> /dev/null<br>ls > /dev/null<br>find / -name "tempfile" 2> /dev/null</span>
<br><br>
 
===The Here Document===
 
[[Image:Here Document.png|thumb|right|175px|The '''Here Document''' allows a user to redirect stdin from <u>within</u> the command itself.]]
13,420
edits

Navigation menu