Redirection in Linux
July 17, 2014
Redirection Basics
Output umleiten:
code
ls -al > listing.txt
> ueberschreibt die Datei.
>> haengt an:
code
echo "hello" >> hello.txt
Input
code
wc -l < listing.txt
Stdout vs Stderr
- Stdout = FD 1
- Stderr = FD 2
code
command > out.txt 2> err.txt
command > out.txt 2>&1
command &> all.txt
Tipp
Wenn du sowohl Log als auch Errors brauchst: erst > dann 2>&1.