The Tilde In Your PATH May Not Be Your HOME
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Before you orderOffer from Amazon

Get comfort and recovery gear delivered free with Prime

  • Fast, free delivery on millions of items
  • Prime Video, Amazon Music and more included
  • Member-only deals all year
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

A report published by Disconnect3d on Oct. 2 says that quoting a PATH assignment such as `export PATH=”$PATH:~/.local/bin/”` can leave the tilde literal instead of expanding it to the home directory. The suggested fix is to use `$HOME`, and the report offers commands to find PATH entries that still contain `~`.

A report published by Disconnect3d on Oct. 2 warns that a commonly used shell configuration, `export PATH=”$PATH:~/.local/bin/”`, may add a literal `~/.local/bin/` entry rather than the directory under a user’s home folder. The report recommends using `$HOME/.local/bin/` instead, a distinction that can affect which executable a shell finds and may matter to tools that inspect writable PATH locations.

Disconnect3d said the issue came to attention while using the nono agent sandboxing tool, which displayed a warning about PATH entries the sandbox could write to. The report author found the displayed `~/.local/bin/` suspicious and traced it to how shells handle tilde expansion. In the quoted assignment, the tilde is inside double quotes, so it is not expanded as a home-directory prefix.

As a result, a shell can treat the entry as the relative path `./~/.local/bin/`, rather than a path such as `/home//.local/bin/`. Disconnect3d illustrated the behavior by creating a directory named `~` in the current working directory, placing a test executable there, and running it with that literal path in `PATH`. The executable ran, showing that the home directory was not involved in that example.

The suggested replacement is `export PATH=”$PATH:$HOME/.local/bin/”`. The report also notes that an unquoted assignment such as `export PATH=$PATH:~/.local/bin` can expand successfully in Bash and Zsh. However, the author describes relying on that behavior as fragile, since whitespace can alter how the shell parses an assignment.

At a glance
reportWhen: Published Oct. 2, 2026
The developmentDisconnect3d published a report explaining how quoted tilde paths in shell startup files can remain literal PATH entries, along with a check and a suggested fix.

How a PATH Entry Can Mislead

The issue matters because PATH controls where a shell looks for commands. If a startup file adds a literal tilde path, a command might be found in a directory relative to the current working directory instead of in the user’s home directory. Disconnect3d’s example shows that a program placed in such a relative directory can be executed when its name is entered, provided the directory is in PATH.

The report also connects the mistake to security checks on writable PATH locations. A sandbox warning about writable entries may be harder to interpret if a user assumes `~/.local/bin/` necessarily means a home-directory location. The report establishes the shell-expansion behavior and demonstrates a test case; it does not claim that every quoted tilde entry creates a security incident or that the nono warning itself proves an exploit.

Amazon

Linux shell scripting guide

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

The Shell Expansion Rule

In its discussion, Disconnect3d points to the Bash documentation, which says tilde expansion applies when a word begins with an unquoted tilde prefix. Bash also checks certain variable assignments for unquoted tilde prefixes immediately after a colon or the first equals sign. This explains why an unquoted tilde after a colon can behave differently from the same character inside double quotes.

The difference is between the literal character `~` and the home-directory value; a PATH string is not automatically rewritten just because it contains a tilde. The blog post discusses Bash and Zsh and recommends `$HOME` as the less fragile form. It does not provide a comparison of behavior across every shell or operating system.

““export PATH=”$PATH:$HOME/.local/bin/”””

— Disconnect3d, describing the recommended fix

Amazon

command line path management tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Limits of the Reported Example

The report does not say how many people have affected shell configuration files, how often this mistake occurs, or whether the behavior causes problems in a particular user’s setup. Its demonstration is a reproducible example, not evidence of a widespread incident. The author also does not document testing across shells beyond the stated Bash and Zsh behavior.

Disconnect3d said a pull request was forthcoming to make nono’s warning more verbose. The source does not confirm whether that change was submitted, accepted, or released. It also does not report any compromise or other security impact tied to the warning.

Amazon

home directory navigation tools

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Check Startup Files and Tool Changes

Readers can inspect their current PATH with the commands in the report: `echo “$PATH” | grep — ‘~’` searches the full value, while `echo “$PATH” | tr ‘:’ ‘\n’ | grep ‘~’` prints matching entries separately. A result means the PATH string contains a tilde; users should check their shell configuration to determine whether that entry is intentional and how it was assigned.

Disconnect3d recommends checking `.bashrc`, `.zshrc` and `.profile` and replacing an affected tilde with `$HOME`. The next reported development is the proposed nono warning improvement; the original post does not provide a timeline or confirm its status.

Amazon

shell configuration troubleshooting

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What is the PATH tilde problem?

A quoted assignment such as `export PATH=”$PATH:~/.local/bin/”` can preserve `~` literally instead of expanding it to the user’s home directory. The entry may then refer to `./~/.local/bin/` relative to the current directory.

What should I use instead?

Disconnect3d recommends `$HOME/.local/bin/`, for example: `export PATH=”$PATH:$HOME/.local/bin/”`.

How can I check whether PATH contains a tilde?

Run `echo “$PATH” | tr ‘:’ ‘\n’ | grep ‘~’` to print PATH entries containing `~`. Then check the relevant shell startup file to see how each entry is defined.

Does finding a tilde in PATH prove my system was compromised?

No. The report describes a shell configuration behavior and a test demonstration, not evidence of a compromise. A matching entry is a reason to inspect the configuration and understand what directory it refers to.

Source: hn

Wellness content on this site is informational and not a substitute for professional medical guidance.
HALLOWEEN

Halloween Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Apple’s iPhone 18 Goes On Sale As Customers Line Up At Stores Worldwide

Customers worldwide line up as Apple begins sales of the iPhone 18, marking a significant product launch with high consumer interest.

The Workday Has a Comfort Problem. AI Has a Judgment Problem.

A live AI company experiment reveals why spotting a crisis is not enough: models also need to protect trust, find buried evidence and follow through.

Watch a Company Lose Money Every Day — Powered by AI That Faces the Same Crises as Humans

A real-time experiment shows AI managing a cash-losing software company, facing crises and manipulations, revealing insights relevant to workplace stress, trust, and decision integrity.

The Top Tech Trends At IFA Berlin 2026

Key technology trends at IFA Berlin 2026 include AI integration, wearable tech advances, and eco-friendly devices, driven by rising consumer interest and industry innovation.