Skip to content

find command interprets standalone forward slash / as a DOS switch instead of a Unix path #149

Description

@spritetong

Description

With the Coreutils for Windows release, the find multi-call binary handles both Unix-style find and legacy DOS find compatibility. However, when executing a standard Unix find command and specifying the root or a path using a standalone forward slash /, the parser/dispatcher mistakenly treats / as a DOS-style switch prefix rather than a positional path argument. This triggers the legacy Windows find error.

Steps to Reproduce

Run the following command in a terminal where Coreutils for Windows is active:

Bash

find / -name *.txt

Expected Behavior

The command should be routed to the Unix-style find utility, treating / as the starting directory path for the search.

Actual Behavior

The command fails immediately with the legacy DOS find.exe error message:

Plaintext

FIND: Invalid switch

Environment / Context

  • OS: Windows 11

  • Installation Method: winget install Microsoft.Coreutils

  • Shell: PowerShell 7+ / CMD

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions