Windows: Printing Date and Time on Command Line
I am more of a *nix (unix, linux etc) command line person but I still use windows from time to time (in this case because my macbook pro crashed).
I often want to see the progress of output to a file over time using the following linux command line:
$ date; wc -l output.txt
On windows date does not print time (you have to do ‘date \t’ to get output from it otherwise it used for changing the system date).
I finally found what I was looking for:
> echo %DATE% & echo %TIME% & wc -l output.txt
Output:
Thu 07/21/2011 13:44:55.70 375 output.txt
The wc command and bunch of other unix commands come from the free UnixUtils opensource package for windows. I consider UnixUtils a must have for windows and among the first thing I install on my windows machine.
Nice tip about UnixUtils. I am glad you are still tinkering with Windows and as for the MacBook Pro crashing… I only wonder, had it been windows, what choice words would you be using for Microsoft right now. In this fiasco, I see no bile spewed towards and Apple and Jobs. This is fascinating!
I have been very heavy into Linux in the last few days and I recommend using Wubi to install Ubuntu on your Windows box to dual boot in Linux without creating a partition.
Arsalan A.
September 20, 2011 at 5:18 am