Windows Instructions to fix: `bash: gdu: command not found`
ElectricRCAircraftGuy opened this issue · comments
In Windows, gdu
must be run as gdu_windows_amd64.exe
instead. Please make this obvious to others.
bash: ncdu: command not found
I figured it out, but this is to help:
- Myself, later
- Others
I am using gdu
in Windows as a replacement for ncdu
which I have used for years in Linux Ubuntu.
I installed gdu
into Windows by running winget install gdu
in the Git Bash terminal. I think you can also use the cmd prompt, but that's besides the point. It seems to have installed fine.
Problem
I closed and re-opened my Git Bash terminal, and when I run gdu
I get this error:
$ gdu
bash: gdu: command not found
Solution
If you type gdu
and press Tab to auto-complete the command, it expands out into gdu_windows_amd64.exe
, meaning that is the command we should be running! Running that command (gdu_windows_amd64.exe
) works fine.
Running which gdu_windows_amd64.exe
shows that the executable is located in /c/Users/my_username/AppData/Local/Microsoft/WinGet/Packages/dundee.gdu_Microsoft.Winget.Source_8wekyb3d8bbwe/gdu_windows_amd64.exe
.
So, create a ~/.bashrc
file in Windows, at path /c/Users/my_username/.bashrc
as specified in Git Bash in Windows, and add the following alias to the bottom of it:
alias gdu="gdu_windows_amd64.exe"
Now, close and re-open all Git Bash terminals, and you can now run either gdu
or gdu_windows_amd64.exe
!
Recommendation
In your main README, change this:
[Winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/d/dundee/gdu):
winget install gdu
To this:
[Winget](https://github.com/microsoft/winget-pkgs/tree/master/manifests/d/dundee/gdu) (for Windows users):
winget install gdu
Now, either run it as `gdu_windows_amd64.exe`, *or* add `alias gdu="gdu_windows_amd64.exe"` to the bottom of your `~/.bashrc` file when using the Git Bash terminal, and run it as `gdu`.
Pull request: #278
Your change was merged in. Thank you.