Windows tricks

May 20, 2008
10,280
73
Syracuse, NY, USA
I just discovered these today.

1. Win10's SORT.EXE has an uncocumented "/case" option to make it case-sensitive

Code:
d:\data\tcclibrary> (echo b^r^nB^r^nA^r^Na) | sort
A
a
b
B

d:\data\tcclibrary> (echo b^r^nB^r^nA^r^Na) | sort /case
a
A
b
B
2. Win10's SORT.EXE has an undocumented "/unique" option to make it remove duplicate lines (line UNIX's 'sort -u' or 'sort | uniq')

Code:
d:\data\tcclibrary> (echo 1^r^n2^r^n1^r^n2) | sort
1
1
2
2

d:\data\tcclibrary> (echo 1^r^n2^r^n1^r^n2) | sort /unique
1
2
3. Piping to FIND.EXE /c /v "" will give you a line count (like UNIX's 'wc -l')

Code:
d:\data\tcclibrary> (echo 1^r^n2^r^n1^r^n2) | find /c /v ""
4
 
Oct 18, 2009
322
12
I checked Microsoft's on-line info and there are several parameters not listed there, such as /T[emporary].

There is no /help parameter. When I typed sort /? from a TCC prompt it gave the list but I can't scroll back to the top. (TCC 22.00.43, Win 10 Pro 32-bit.