Comments on: Findstr: Find Specific String In Files With Windows Command (Grep Alternative) https://www.itechtics.com/using-findstr-windows/ Making Technology Accessible Wed, 31 Aug 2022 13:21:17 +0000 hourly 1 https://wordpress.org/?v=6.4.1 By: Usman Khurshid https://www.itechtics.com/using-findstr-windows/#comment-187241 Tue, 25 Aug 2020 11:46:34 +0000 https://www.itechtics.com/?p=30434#comment-187241 In reply to NPadmanabhan.

What other commands do you normally use in Linux and Unix that are not available in Windows?

]]>
By: OKRickety https://www.itechtics.com/using-findstr-windows/#comment-166785 Thu, 18 Jun 2020 18:14:00 +0000 https://www.itechtics.com/?p=30434#comment-166785 The author seems to have forgotten the article was also to discuss “how to use the find function using PowerShell”.

]]>
By: NPadmanabhan https://www.itechtics.com/using-findstr-windows/#comment-166489 Wed, 17 Jun 2020 07:00:46 +0000 https://www.itechtics.com/?p=30434#comment-166489 Thanks for giving the grep equivalent in windows. I wish you come up with equivalents of all commonly used unix commands and compile in a file so that users like me can use it as a reference book. Thanks once again.

Padmanabhan

]]>
By: Beau https://www.itechtics.com/using-findstr-windows/#comment-127917 Thu, 19 Dec 2019 22:17:47 +0000 https://www.itechtics.com/?p=30434#comment-127917 I’ve been trying to find filenames that start with a certain string.
I started by finding all files within a certain directory which contains a bunch of sub directories and such by ‘dir * /s/b | findstr “.*\..*”‘ I pipped the results to a DirectoryListing.txt file to store all the paths.
I also have a List.txt file which contains strings of filenames, ie: ‘12345’. Each filename is on its own line.
I then tried to find all filenames that start with strings contained within the List.txt from my DirectoryListing.txt file. In doing so I got filenames that didn’t start with my searched string. If I took my string ‘12345’, I would expect to get back filenames that start with ‘12345’, but I also received filenames that included a hyphen ’11-12345′. Like in your example where you FINDSTR ‘reader’ it returned “adobe-reader-…”.
This is how I am trying to parse the file: For /F “Delims=|” %%X In (‘FINDSTR /IRC:”\” “%destination%\%DirList%”‘)
%%A is the string to find, ie: ‘12345’
%DirList% is my DirectoryListing.txt

My question is how would I be able to use FINDSTR to find filenames that start with a certain string and not have a ‘-‘ hyphen before the string?

]]>
By: Usman Khurshid https://www.itechtics.com/using-findstr-windows/#comment-110513 Wed, 30 Oct 2019 12:14:44 +0000 https://www.itechtics.com/?p=30434#comment-110513 In reply to teo.

The closest alternative of grep in Windows is findstr. We can’t compare all the features of each command but the basic function of the commands is the same.

]]>
By: teo https://www.itechtics.com/using-findstr-windows/#comment-110512 Wed, 30 Oct 2019 11:52:26 +0000 https://www.itechtics.com/?p=30434#comment-110512 Do I understand correctly: findstr matches a STRING, not a regular expression pattern, right?

And you call that an “equivalent to grep”??

]]>
By: dasra https://www.itechtics.com/using-findstr-windows/#comment-56835 Tue, 25 Jun 2019 20:22:21 +0000 https://www.itechtics.com/?p=30434#comment-56835 I am trying to filter a gitbranch name so I used git branch | findstr “*” it is outputting a branch name but including the * sign. I was wondering if there is any way to select the exact name of the branch and save it to the string.
SPecially for branches lik rel-0.1 it is not working.

I am trying to convert git branch | grep \* | cut -d ‘ ‘ -f2 | git pull origin from bash script to
>git branch | findstr “*” | git pull origin but anytime the branch name is like rel-0.1 it does not work but for others it is working.
The goal is to pull origin from the current selected branch.

]]>