| « The "www." prefix is dead.... or almost ! | PHP Session management - The middle of a month is wrapped... ...yes wrappers again ! » |
From time to time I need to redirect standard output and also standard error either in a file or nowhere...
I do know how to do that but whenever I need that thing... I can't remember it and end up searching... and of course loosing time on this !
So once again...
To redirect standard output to /dev/null you will issue:
[gabriel@radical ~]#command.sh > /dev/null
To redirect standard error to standard output you will need to:
[gabriel@radical ~]#command.sh 2>&1
And now to put it all together... and completely made a script silent:
[gabriel@radical ~]#command.sh > /dev/null 2>&1
Of course this is not only for /dev/null... you can send all in a text file
[gabriel@radical ~]#command.sh > results.log 2>&1
Now I know where it is... in a file or in /dev/null !!!
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Recent comments