In Linux, from a bash shell, how can I print the contents of a file and remove the content I just printed content from the file?
I have a program writing texts to a file repeatedly. On a Linux shell prompt, I want to print the contents of the file and then delete the printed contents from the file. I want to do this repeatedly, to make my file size small enough.
Do we have bash command lines or combinations to do that?