can someone help me with the unix command to trim the contents of files in a directory. I use Cygwin in windows.
for file in * do >$file done
Just redirect from nowhere:
> somefile.txt
If you want to truncate the file in order to save the n last lines of the file, you can do something like (500 lines in this example)
mv file file.tmp && tail -n 500 file.tmp > file && rm file.tmp
Source: https://habr.com/ru/post/1303124/More articles:FileNotFoundException sometimes at application startup - c #Can I make a simple init string with the format using @ "- stringenable disabling asp.net validation elements using jquery - jqueryProgramming huawei E220 - .netHow to put a variable value inside a resource file value - .netfull ajax website and SEO - ajaxsoftware protection to run on only one computer in vb.net - vb.netT-SQL: Multiple Separator Parsing - splitSQL Management Studio 2008 - server name on the tabs Query Editor ... where did they go? - sqlHow can we make this code work with the strict on option? - vb.netAll Articles