How to run Windows command prompt utilities options in Git Bash (how to specify /slash options)?

5,341

Solution 1

Change the slash to a dash. At least it did work for me on 1.9.4 on Windows 7.

$ ipconfig -all

Alternatively escape the / by using \/.

$ ipconfig \/all

Solution 2

It should be ipconfig //all (two forward slashes).
It also works in git bash; this is what is called POSIX path conversion and is documented here.

Share:
5,341

Related videos on Youtube

Green
Author by

Green

Node.js React, Redux JavaScript AWS

Updated on September 18, 2022

Comments

  • Green
    Green over 1 year

    An example that doesn't work in Git Bash but only in Windows prompt:

    // Git Bash
    $ ipconfig /all
    Error: unrecognized or incomplete command line.
    
    // Windows
    User> ipconfig /all
    C:\Users\sergey>ipconfig /all
    
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : HOST-12345
       Primary Dns Suffix  . . . . . . . :
       Node Type . . . . . . . . . . . . : NodeType
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       ... so on
    

    How to provide slash option in Git Bash /all, /renew, etc

    • barlop
      barlop over 7 years
      i'm curious, do you find git bash has any advantage over just adding git to the path?
    • Green
      Green over 7 years
      @barlop, It has many UNIX utilities enabled, like ls, ll, touch, cat, curl, ssh, so on. Copy on select. Place command line cursor by click. It has colors.
  • Green
    Green over 7 years
    Escape didn't work for me, but a dash did the trick. Thanks!
  • Kenneth Chan
    Kenneth Chan almost 4 years
    it help. but if the code is in a bat file. it won't work.