I want to find the necessary attribute through the command's help output. How to do it? Output like this: help output
2 Answers
Let's say you are looking for the /H switch:
Program.exe /? |find /i "/h"
Program.exe --help |find /i "/H"
That should only show you the line where there is an "/H" occurrence.
Some programas also accept:
program.exe /h /? program.exe /h --help
Let's say I want to find the flags available for the a command within the terminal. For brevity, let's pick "replace".
You can type either of the following:
help replace | findstr "\/"
help replace | find "/"
to find all lines that have a forward slash (backslash is used to escape the forward slash).
Below an example with findstr and regex to filter network connections:
netstat -n | findstr -r "127.*"
Both find and findstr serve the same purpose but findstr is newer and supports regex. To learn about the difference, you can check this answer in SuperUser.