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.

One Response
  1. September 20, 2011