I often force process to not display their output so that I can more easily run multiple of them in the background, for example:
youtube-dl -f 22 https://www.youtube.com/watch?v=oyg0xYH12Qg &>/dev/null &
without &>/dev/null
they display information on the shell such as
[download] 69.5% of 1.34GiB at 360.36KiB/s ETA 19:53
What if I want to know those information with a command ?
If you send the output of a command to
/dev/null
, it's gone and you can't retrieve it. It would probably be a better idea to send the output to a place that doesn't get in your way, but where you can look it up if you need to.Several options come to mind: If you're working with a GUI, you could just use a separate terminal emulation window and minimize that. Some terminal emulators also offer tabs. With that, you could run the download (or whatever command) in one tab and do other work in another tab.
In a TUI (text based user interface), a terminal multiplexer like GNU
screen
ortmux
could be a solution. With those, you can use multiple windows and/or split the screen into multiple sections. So, you could run your download in one window or split, and do other work in other window(s) or split(s).A third way could be to just redirect the output to a file instead of to
/dev/null
. If you need it, you can look up the output in the file, and if you don't, it's not in your way. You'd only have to remember to clean up those files every once in a while (or use a place that gets cleaned up routinely, like/tmp
).