At work, I run many simulations from the command line, and I want to capture the output into a file, but also to continue to see the output in the command line. My current workflow is to run something like this:
run sim_0425 > sim_0425.log & tail -f sim_0425.log
This does exactly what I want, but the issue is that the logfile will be named something different each time depending on the simulation parameters (for example, here it's "sim_0425"), and it's kinda kludgey to manually rename it in all locations each time. I'll often forget to rename it one of the locations, and then I'll rewrite a file somewhere.
I can't imagine that there isn't some built-in way to output to a file and to the std out stream simultaneously. Googling this is challenging because I'm basically searching for "> & tail" and that doesn't turn much up :/