-
Notifications
You must be signed in to change notification settings - Fork 3
Redirections
stachu edited this page May 21, 2019
·
1 revision
In fact: duplicating
When anything like 2>&1
is encountered, it means that anything that descriptor 2 contains is copied to descriptor 1, thus the order of "redirects" matter:
ls / not_existing_file 2>&1 1>/dev/null
- the stderr
is copied to whatever the descriptor 1 points to (stdout
by default), the stdout
is copied to /dev/null
, the stderr
is not updated
ls / not_existing_file 1>/dev/null 2>&1
- the stdout
is copied to /dev/null
the stderr
is copied to whatever the descriptor 1 points to (dev/null
in this case)
To close descriptor, duplicate -
, e.g.:
Close stdin: 0<&-
Close stdout: 1<&-
- General
- OS
- Networks
- Configuration
- Protocols
- Link layer
- Sockets
- Routing
- Tunneling
- Debugging
- LoRa
- Virtualization
- Infrastructure as a code
- Desktop environments
- Monitoring
- Benchmarking