As a developer, working with Git, Docker, and Shell is a very common task. The command-line interface can be intimidating for beginners, but it is a powerful tool that can save time and streamline workflows. In this blog post, we will cover essential commands that I needed a lot recently and will help you as a developer to make your work more efficient and effective.

You can also find all commands explained in this post listed in this public gist that I update regularly.

Git

Docker

  1. Get port of a container running in Docker Compose

    docker-compose port SERVICE_NAME INT_PORT | grep -P ':\\d+' -o | grep -P '\\d+' -o
    

Shell

Common commands that you can use in Shell/Bash under Linux/Unix. If you are on windows most of the commands should also work if you use WSL. I’m using WSL heavily meanwhile especially to try deploy scripts, before pushing them to GitLab and can highly recommend it. Here are Shell commands I find especially useful: