can someone help me with unix command to truncate the contents of the files in the directory. I am using Cygwin in windows.
Thanks, wow, that works i am curious to know how/why ? redirection from nothing to the file makes content empty.
Anil Namde
2010-03-04 14:24:18
A:
If you want to truncate a file to keep the n last lines of a file, you can do something like (500 lines in this example)
mv file file.tmp && tail -n 500 file.tmp > file && rm file.tmp
David V.
2010-03-04 14:11:43