• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

gitbash

JQ on GitBash

July 7, 2021

JQ is a json processor. It’s for slicing and dicing data.

Download

To install on GitBash, unzip the file and copy the executable to /usr/bin.

mv jq-win64.exe to /usr/bin/jq.exe

mv jq-win64.exe to /usr/bin/jq.exe

Create an alias. Edit ~/.bashrc.

alias jq='/usr/bin/jq.exe'

alias jq='/usr/bin/jq.exe'

Using JQ.

jq --version
jq '.selfLink' vm.json

jq --version jq '.selfLink' vm.json

Filed Under: Linux Tagged With: gitbash, install, jq, json, processor

GitBash .bashrc

April 1, 2020

Here’s how to find your GitBash .bashrc.

# cd takes you to gitbash home
cd 
# edit .bashrc
vim ~/.bashrc

# cd takes you to gitbash home cd # edit .bashrc vim ~/.bashrc

You can add aliases, change prompt styles, etc.

export PS1="\w: $ "
alias gcloud="gcloud.cmd"
alias gsutil="gsutil.cmd"
alias code="cd ~/Code"
cd Code

export PS1="\w: $ " alias gcloud="gcloud.cmd" alias gsutil="gsutil.cmd" alias code="cd ~/Code" cd Code

Filed Under: Cloud Tagged With: .bashrc, alias, gcp, gitbash, prompt

Run Bash Script in GitBash

February 8, 2019

Unfortunately, you can’t run Bash scripts in GitBash the normal way. Here’s the workaround. You have to use sh script.sh

# Normal use
./script.sh
# Running it in GitBash
sh script.sh

# Normal use ./script.sh # Running it in GitBash sh script.sh

Filed Under: Linux Tagged With: gitbash, run, sh

  • Home
  • About
  • Archives

Copyright © 2023