uutils / uutils/coreutils

Cannot recognize `~` in Windows

Open
#5,829 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

In powershell, ~ is used to refer to %HOME%.

For example, when running dir ~, it lists all files and folders under %HOME%, which is usually C:\Users\YOUR_USERNAME\.

However, when running for example, rm -rf ~/.cache or ls -a ~, it says:

rm: cannot access '~': No such file or directory
ls: cannot access '~': No such file or directory

Before I used Busybox-w32, which supports the ~ mark. I wish it could recognize it.

Anyway, it can recognize $HOME in powershell, as $HOME is just the absolute path, which can be tested with echo.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce dir ~, rm -rf ~/.cache, and ls -a ~ in PowerShell, then trace how uutils/coreutils receives and interprets the path argument. Compare the stated $HOME behavior with BusyBox-w32's tilde handling; done when the examples resolve ~ to the user's home directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.