Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Windows tricks

May
12,834
163
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
 
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.
 
I'm attaching a text file with the full sort text plus the undocumented parameters.
 

Attachments

  • Win 10 Sort command Help with undocumented options.txt
    2.4 KB · Views: 344
Back
Top