To write the output of a command to a file, there are basically 10 commonly used ways. overview https://askubuntu.com/a/731237 Setup iterm2 cursor move https://stackoverflow.com/a/22312856/2593181