Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Instructions to fix: bash: gdu: command not found #279

Closed
ElectricRCAircraftGuy opened this issue Sep 11, 2023 · 1 comment
Closed

Comments

@ElectricRCAircraftGuy
Copy link
Contributor

ElectricRCAircraftGuy commented Sep 11, 2023

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:

  1. Myself, later
  2. 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

ElectricRCAircraftGuy added a commit to ElectricRCAircraftGuy/eRCaGuy_dotfiles that referenced this issue Sep 21, 2023
@danie-dejager
Copy link
Collaborator

Your change was merged in. Thank you.

@danie-dejager danie-dejager changed the title Windows Instructions to fix: bash: ncdu: command not found Windows Instructions to fix: bash: gdu: command not found Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants