Save STDOUT/STDERR to clipboard (and more)
Summary: How to redirect the STDOUT or STDERR stream to clipboard.
Note to self (mostly), in case I forget the command that would redirect standard output or standard error stream and save it on the clipboard.Redirect STDOUT to clipboard:
1 | command | clip |
1 | command 2>&1 | clip |
1 | dir | clip |
1 | dir xyz: | clip |
1 2 3 4 | Volume in drive C is SYSTEM Volume Serial Number is 1234-ABCD Directory of C:\Windows\SysWOW64 |
1 | dir xyz:2>&1 | clip |
1 2 3 4 5 6 7 8 | "xyz:" is not a recognized device. "xyz:" is not a recognized device. Volume in drive C is SYSTEM Volume Serial Number is 1234-ABCD Directory of C:\Windows\SysWOW64 File Not Found |
Forgotten (but Awesome) Windows Command Prompt Features by Scott Hanselman
How to pipe stderr, and not stdout?