In MS-DOS, if I enter dir *.pdf, I’ll get all the PDF files in a directory. Is there a way to get everything but PDF files? Something like dir !*.pdf?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think there’s a /v option for findstr which is equivalent to grep -v (include all lines that don’t contain the text. So I’d be looking at:
The syntax may be slightly different, I haven’t had much need to use it and I don’r run Windows at my current location.
Use findstr /? from a command prompt for details.
Or, if you install CygWin (my tool of choice for this sort of stuff), you can just use grep itself:
Addendum:
I actually didn’t realize this but apparently findstr also support regexes so you can use:
just the same as grep (I haven’t tested this, I only just found it on TechNet, so you’ll need to test it yourself).