Input/Output Types Flashcards

1
Q

There are 3 I/O :

A

I/O Name Abbreviation File Descriptor

Standard Input stdin 0
Standard Output stdout 1
Standard Error stderr 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Redirection uses ampersands, greater than, and less than signs:
& < >

A

>

   Redirects standard output to a file
      Overwrites (truncating) existing contents >     Redirects standard output to a file
      Appends to an existing contents. <        Redirects input from a file to a command &     Used with redirection to signal that a file descriptor is being used 2>&1  Combine stderr and standard output 2>file  Redirect standard error to a file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The null device basically throws away what is fed to it. If you don’t want to see errors on your screen and don’t want to save them to a file.`

A

> /dev/null Redirect output to nowhere
$ ls here not-here 2> /dev/null here
$ ls here not-here > /dev/null 2>&1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly