this post was submitted on 23 May 2025
5 points (100.0% liked)

Nix / NixOS

2340 readers
19 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

Whenever I run any command line tools without sudo, they take the settings as in ~/.config and work fine. But whenever I run the same CLI tools with same parameters but with sudo, it falls back to default setting. How can I make this behavior consistent?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] clot27@lemm.ee 1 points 1 month ago* (last edited 1 month ago) (2 children)

Thanks for the heads up! I will try the given solutions.

but that doesn't do anything with ~/.config

What do you exactly mean by this?

The letter ~ (tilde) is relative to the current user. When you use sudo, you become root. So ~ points to /root. Whereas if you are not using sudo then ~ points to /home/yourname