wyatt
asked Feb 07 2017
Answer
Yes, truncate command could be used.
For example:
The file called test is created with some contents, and the below command will remove only the contents but not the file...
# truncate -s 0 [test]
jagannatharumugam
asked Feb 10 2017
edited Oct 05 2018
how to clear only the contents in file
Till now i will remove the file & recreate it. is it possible to clear only the contents instead of removing the whole file.....???