Search code examples
sudogit-bash

Id: cannot find name for group ID 197121


I am running the command : sudo chown -R $USER:$(id -gn $USER) C:\Users\user57.config on windows with git bash and it gives me such error: id: cannot find name for group ID 197121. Any solution?


Solution

  • for git-bash on Windows:

    chown -R $USERNAME:$(id -g $USERNAME) /c/Users/user57.config
    

    explanation:

    • $USER is not set, use $USERNAME instead
    • id -g works, but not id -n, however chown will work with the group id
    • target path with forward slash (rather than backslash) starting with /c/ for the drive letter