tags: windows11 ripgrep

ripgrep installation in Windows (Git Bash):

kaau@OCLT71159526 ~$ cd ${HOME}
kaau@OCLT71159526 ~$ which curl
/c/WINDOWS/System32/curl

#
# download and unzip ripgrep:
#
kaau@OCLT71159526 ~$ cd /tmp
kaau@OCLT71159526 /tmp$ curl -L -o ripgrep-15.2.0-x86_64-pc-windows-gnu.zip \
                        [[yellow:https://github.com/BurntSushi/ripgrep/releases/download/15.2.0/ripgrep-15.2.0-x86_64-pc-windows-gnu.zip]]
  % Total    % Received % Xferd  Average Speed  Time    Time    Time   Current
                                 Dload  Upload  Total   Spent   Left   Speed
  0      0   0      0   0      0      0      0                              0
100  1.79M 100  1.79M   0      0  1.62M      0   00:01   00:01              0

(venv) kaau@OCLT71159526 /tmp$ ls -lh /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu.zip
-rw-r--r-- 1 kaau 1049089 1.8M Aug  8 09:48 /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu.zip

(venv) kaau@OCLT71159526 /tmp$ unzip /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu.zip
Archive:  /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu.zip
   creating: ripgrep-15.2.0-x86_64-pc-windows-gnu/
   creating: ripgrep-15.2.0-x86_64-pc-windows-gnu/complete/
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/complete/rg.bash  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/complete/rg.fish  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/complete/_rg  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/complete/_rg.ps1  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/COPYING  
   creating: ripgrep-15.2.0-x86_64-pc-windows-gnu/doc/
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/doc/CHANGELOG.md  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/doc/FAQ.md  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/doc/GUIDE.md  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/doc/rg.1  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/LICENSE-MIT  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/README.md  
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/rg.exe                                                     ---this!
  inflating: ripgrep-15.2.0-x86_64-pc-windows-gnu/UNLICENSE  

kaau@OCLT71159526 /tmp$ ls -l /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu/rg.exe  
-rwxr-xr-x 1 kaau 1049089 4468736 Jul 15 16:10 /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu/rg.exe
kaau@OCLT71159526 /tmp$ file /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu/rg.exe 
/tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu/rg.exe: PE32+ executable for MS Windows 5.02 (console), x86-64 (stripped to external PDB), 9 sections

kaau@OCLT71159526 /tmp$ mv /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu/rg.exe ${HOME}/bin
kaau@OCLT71159526 /tmp$ which rg
/c/Users/kaau/bin/rg

#
# clean-up:
#
kaau@OCLT71159526 /tmp$ rm -rf /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu.zip /tmp/ripgrep-15.2.0-x86_64-pc-windows-gnu

Dry run:

kaau@OCLT71159526 /tmp$ cd ${HOME}
kaau@OCLT71159526 ~$ ls -l ${HOME}/.bashrc
-rw-r--r-- 1 kaau 1049089 514 Jun  6 12:13 /c/Users/kaau/.bashrc
kaau@OCLT71159526 ~$ cat ${HOME}/.bashrc
[[blue:# generated by Git for Windows]]
[[blue:test -f ~/.profile && . ~/.profile]]
[[blue:]]
[[blue:# Optimized PATH]]
[[blue:PATH="/usr/bin:/bin:/c/Users/kaau/bin"]]
[[blue:PATH="${PATH}:/c/WINDOWS/System32:/c/Program Files/Git/bin"]]
[[blue:PATH="${PATH}:/c/Program Files/Python/Python314:/c/Program Files/Python/Python314/Scripts"]]
[[blue:PATH="${PATH}:/c/Program Files/nodejs"]]
[[blue:PATH="${PATH}:/c/Users/kaau/cdk/node_modules/.bin"]]
[[blue:#PS1='\[\033[32m\]\u@\h\[\033[0m\] \w$([ "$PWD" != "$HOME" ] && echo " ~") $ ']]
[[blue:PS1='\[\033[32m\]\u@\h\[\033[0m\] \w$ ']]

kaau@OCLT71159526 ~$ rg kaau ${HOME}/.bashrc
5:PATH="/usr/bin:/bin:/c/Users/kaau/bin"
9:PATH="${PATH}:/c/Users/kaau/cdk/node_modules/.bin"