Redir/pipes Flashcards
1
Q
STDIN
A
Standard input
0
2
Q
What will this do?
~~~
python hello.py < foo.txt
~~~
A
feed foo.txt to stdin for python
3
Q
STDOUT
A
Standard Out
1
4
Q
python hello.py > output.txt
A
stdout to (file)
5
Q
python hello.py >> output.txt
A
stdout to (file), append
6
Q
STDERR
A
Standard Error
2
7
Q
python hello.py 2> error.log
A
stderr to (file)
8
Q
python hello.py 2>&1
A
stderr to stdout
9
Q
python hello.py 2>/dev/null
A
stderr to (null)
10
Q
python hello.py >output.txt 2>&1
A
stdout and stderr to (file), equivalent to &>
11
Q
python hello.py &>/dev/null
A
stdout and stderr to (null)
12
Q
echo "$0: warning: too many users" >&2
A
print diagnostic message to stderr
13
Q
diff <(ls -r) <(ls)
A
Compare two stdout without files