mirror of
https://github.com/jbranchaud/til
synced 2026-01-19 23:18:01 +00:00
Compare commits
1 Commits
af2bf37528
...
114d446afb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
114d446afb |
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||||
|
|
||||||
_1453 TILs and counting..._
|
_1452 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -1396,7 +1396,6 @@ _1453 TILs and counting..._
|
|||||||
- [File Type Info With File](unix/file-type-info-with-file.md)
|
- [File Type Info With File](unix/file-type-info-with-file.md)
|
||||||
- [Find All Files Matching A Name With fd](unix/find-all-files-matching-a-name-with-fd.md)
|
- [Find All Files Matching A Name With fd](unix/find-all-files-matching-a-name-with-fd.md)
|
||||||
- [Find All Files With A Specific Extension With fd](unix/find-all-files-with-a-specific-extension-with-fd.md)
|
- [Find All Files With A Specific Extension With fd](unix/find-all-files-with-a-specific-extension-with-fd.md)
|
||||||
- [Find Any Dotfiles That Modify Path Env Var](unix/find-any-dotfiles-that-modify-path-env-var.md)
|
|
||||||
- [Find A File Installed By Brew](unix/find-a-file-installed-by-brew.md)
|
- [Find A File Installed By Brew](unix/find-a-file-installed-by-brew.md)
|
||||||
- [Find Duplicate Lines In A File](unix/find-duplicate-lines-in-a-file.md)
|
- [Find Duplicate Lines In A File](unix/find-duplicate-lines-in-a-file.md)
|
||||||
- [Find Files With fd](unix/find-files-with-fd.md)
|
- [Find Files With fd](unix/find-files-with-fd.md)
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
# Find Any Dotfiles That Modify Path Env Var
|
|
||||||
|
|
||||||
Whether you are using `zsh`, `bash`, or some other shell, there are a variety
|
|
||||||
of dotfiles where you can place statements to update the `PATH` env var. These
|
|
||||||
files don't all run in the same contexts and it can be tricky to debug if one
|
|
||||||
is clobbering the path set by another.
|
|
||||||
|
|
||||||
One way to audit how your `PATH` gets set and track down any issues is to find
|
|
||||||
any place where the path may be getting modified in your dotfiles.
|
|
||||||
|
|
||||||
I like to use [`rg` (ripgrep)](https://github.com/BurntSushi/ripgrep) for tasks
|
|
||||||
like this.
|
|
||||||
|
|
||||||
First, I want to check where the `PATH` is explicitly modified.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ rg 'export PATH' ~/\.* --max-depth 0
|
|
||||||
```
|
|
||||||
|
|
||||||
This looks at all instances of dotfiles in my home directory where `export
|
|
||||||
PATH` appears. That should catch the majority of ways that it gets updated.
|
|
||||||
|
|
||||||
Next, because I am using `zsh` as my shell, I want to look for another way my
|
|
||||||
path might be set. `zsh` defaults to setting up `path` as proxy for `PATH` that
|
|
||||||
acts as an array.
|
|
||||||
|
|
||||||
I check for any instances of `path=` or `path+=` in my dotfiles:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ rg 'path\+?=' ~/\.* --max-depth 0
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that the `--max-depth 0` is really important for both because otherwise a
|
|
||||||
ton of irrelevant stuff buried in deeply-nested dot-directories will be
|
|
||||||
surfaced.
|
|
||||||
|
|
||||||
If you want just a file name summary of the results, tack on a `-l` flag.
|
|
||||||
Reference in New Issue
Block a user