I need to delete all lines in a file, but leave essentially an empty file with no content and no lines. As best I know, one can do this:
rm file.txt 2> /dev/null
touch file.txt
However, is there a simpler, more canonical solution in BASH?
I need to delete all lines in a file, but leave essentially an empty file with no content and no lines. As best I know, one can do this:
rm file.txt 2> /dev/null
touch file.txt
However, is there a simpler, more canonical solution in BASH?