Just how could I bear in mind just how to make use of redirection?
I recognize what
program > /dev/null 2>&1
does. It reroutes the result to
/dev/null and also
2>&1 suggests to reroute the mistake result in the very same area where the result is sent out.
My trouble is I constantly need to google it due to the fact that I never ever remember it.
So, I attempt
1>&2 ... I attempt every mix till I google it ...
What's the method to bear in mind it conveniently?
Draw it in your wallpaper.
Currently, seriously, this and also various other standard things I maintained neglecting, so I included a fast pointers food selection to an application I created which I make use of daily. You could intend to offer it a shot or usage something like gnote to maintain a note.
Output is far better than mistake so it precedes (1 vs 2 ).
> is shorthand for 'mosts likely to'. Left wing is what I intend to send and also on the right is where I intend to send it. Given that 'where' is (virtually ) constantly a documents, something like
program > /dev/null 2>1
would certainly reroute to a documents called 1. Hence, the ampersand
(&) changes the documents to submit descriptor.
However, I have not find neither established my very own mnemonic, yet when I was first understanding * nix, I located this sensible means to function well. After a couple of rundowns, it comes to be acquired behavior.