• Skip to primary navigation
  • Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

git bash

Docker Exec

by Ulysses · Apr 9, 2021

If you want to SSH to a Docker container, use the Docker exec command.

docker exec -it container_name bash

docker exec -it container_name bash

I’m using a Git Bash terminal, so I have to prefix the docker command with winpty.

winpty docker exec -it container_name bash

winpty docker exec -it container_name bash

Result

root@681bbe3f65f1:/var/www/html#

root@681bbe3f65f1:/var/www/html#

Ctrl-D to exit.

Filed Under: Linux Tagged With: bash, container, docker, exec, git bash

GitBash Path

by Ulysses · Apr 4, 2021

Open Git Bash. Change to the root directory of Git Bash.

cd ~
echo $PATH
/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin

cd ~ echo $PATH /bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin

Edit .bash_profile or .bashrc. It was .bash_profile in my case. Showing a truncated path.

Add your custom path to the PATH variable. Save file. Exit Git Bash.

PATH="/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/c/custom/path"

PATH="/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/c/custom/path"

Open Git Bash again and check your updated Path.

echo $PATH

echo $PATH

Result.

/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/c/custom/path

/bin:/c/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk/bin:/c/custom/path

Filed Under: Windows Tagged With: edit, git bash, path

Git Bash Path

by Ulysses · Aug 19, 2020

Here’s how to add or edit the PATH in Git Bash. Edit your bash_profile.

vi ~/.bash_profile

vi ~/.bash_profile

Set your path by adding the new path at the end.

PATH="/c/WINDOWS/system32:/c/Users/firstname.lastname/google-cloud-sdk/bin"

PATH="/c/WINDOWS/system32:/c/Users/firstname.lastname/google-cloud-sdk/bin"

The example path listed above is truncated for brevity.

Filed Under: Cloud, Linux Tagged With: add, bash_profile, gcloud, git bash, path

Copyright © 2012–2021