Last active
June 27, 2022 16:04
-
-
Save ConnerWill/cb76af23477563bd59ab6a7b83b6a8d7 to your computer and use it in GitHub Desktop.
Hide stdout and stderr with this code after your command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################# | |
############################################################################# | |
## ## | |
## Hide stdout and stderr with this code after your command ## | |
## ## | |
## > /dev/null 2>&1 ## | |
## ## | |
## EXAMPLE: ## | |
## ## | |
## This command will now show any output: ## | |
## ## | |
## ls -A -l /nonexistent > /dev/null 2>&1 ## | |
## ## | |
## This command outputs the dir doesnt exist without '> /dev/null 2>&1': ## | |
## ## | |
## $ ls -A -l /nonexistent ## | |
## ls: cannot access '/nonexistent': No such file or directory ## | |
## [1] 88237 exit 2 ls -A -l /nonexistent ## | |
## ## | |
############################################################################# | |
############################################################################# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment