Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Console Foundations Environment and Redirection Find and Grep

Sean Walsh
Sean Walsh
817 Points

FIND command on Windows Powershell

I'm completely new to Console commands and have been mostly using the Treehouse console terminal. While learning the find command in this video I figured I'd test it out on my actual computer using Windows Powershell.

When I try to use the find command all I get is this:

FIND: Parameter format not correct

The command I was using is: find . -name "filename-here"

Any insight into why this wouldn't work? Is powershell not the best to use for these? Just trying to understand.

I too use Windows. From my understanding, findstr is the window equivalent to FIND. http://www.mkyong.com/linux/grep-for-windows-findstr-example/

The first section of this course addresses this: Windows is not POSIX compliant at all, and this course covers only POSIX compliant consoles.

That said, the equivalent command you're looking for is Get-ChildItem with the -Recurse and -Include or -Filter parameters. Read more about it with help Get-ChildItem -Full or search the internet for examples.

On Windows 10, you can get a POSIX-like console with Windows Subsystem for Linux. It's closely integrated with Windows and achieves decent interoperability. Virtual machines are another option, though they use more overhead and don't integrate as tightly.

1 Answer

Sean Walsh
Sean Walsh
817 Points

Thanks for the answer Luis Marsano . This stuff is all still kind of new to me and I hit a roadblock when trying to get this working. I'm going to take a look at Windows Subsystem for Linux link you provided and see if I can get that working somehow. I tried doing virtual machine stuff but also couldn't get that working.