A comprehensive collection of shortcut commands to simplify your Docker workflow. This script installs short, easy-to-remember aliases and helper scripts into your system path.
- Linux/Unix Environment
- Docker installed and running
curlorwget(for installation)- Root/Sudo privileges (for installation)
- Simplified Commands: Replace long Docker commands with 3-4 letter shortcuts.
- Enhanced Output: Custom formatting for
docker psanddocker inspect. - Safety: Scripts are installed with proper permissions (
755). - Management: Easy install, uninstall, and update mechanisms.
- Self-Documenting: Built-in
dhpcommand to list all available shortcuts.
| Command | Description | Equivalent Docker Command / Function |
|---|---|---|
dhp |
Help | Lists all installed commands |
dpl |
Pull image | docker pull |
dis |
List images | docker images |
drn |
Run container | docker run |
dps |
List all containers | docker ps -a |
dpe |
List exited containers | docker ps -a -f "status=exited" |
dhc |
Healthcheck status | Custom script to show container health status |
dpp |
List ports | Show container ID, Names, and Ports |
dpi |
List running summary | Show ID, Time, Status, Image, Names |
dpia |
detailed list | Show Names, ID, Status, Ports, Image, Command, Time |
dsp |
Stop container | docker stop |
dst |
Start container | docker start |
drt |
Restart container | docker restart |
dre |
Rename container | docker rename |
dec |
Exec (bash) | docker exec -it <container> /bin/bash |
decx |
Exec (sh) | docker exec -it <container> /bin/sh |
dls |
Logs (tail) | docker logs --tail 20 -f |
drm |
Remove container | docker rm -f |
dri |
Remove image | docker rmi -f |
dit |
Inspect | docker inspect |
ditj |
Inspect (JSON) | docker inspect --format "{{json .Config}}" |
dvl |
List volumes | docker volume ls |
dss |
Stats | docker stats |
drs |
Remove stopped | Remove all exited containers |
dhy |
History | docker history |
ddi |
Remove dangling | Remove all dangling images |
drntest |
Run test container | docker run -itd --name=test ... |
dup |
Compose Up | docker compose up -d (supports profiles) |
ddown |
Compose Down | docker compose down (supports profiles) |
You can install the commands using one of the following methods:
Using wget:
bash <(wget -qO- https://raw.githubusercontent.com/meibraransari/Docker-Short-Command/main/docker_short_command.sh)Using curl:
bash <(curl -s https://raw.githubusercontent.com/meibraransari/Docker-Short-Command/main/docker_short_command.sh)If you encounter the error bash: /proc/self/fd/xx: No such file or directory, use this method:
Using wget:
wget https://raw.githubusercontent.com/meibraransari/Docker-Short-Command/main/docker_short_command.sh -O docker_short_command.sh
sudo bash docker_short_command.sh installUsing curl:
curl -fsSL https://raw.githubusercontent.com/meibraransari/Docker-Short-Command/main/docker_short_command.sh -o docker_short_command.sh
sudo bash docker_short_command.sh installcurl -fsSL https://raw.githubusercontent.com/meibraransari/Docker-Short-Command/main/docker_short_command.sh | sudo bash -s installNote
Windows Users: Process substitution <(...) doesn't work in Git Bash on Windows. Use Method 2 or Method 3 instead.
Tip
Running the script without arguments will open an interactive menu where you can choose to Install, Uninstall, Help, or Update.
To update your scripts to the latest version found in the repository:
sudo docker_short_command.sh update(Note: Since the script itself isn't installed to bin, you might need to re-run the curl/wget command or keep the script locally)
If you have the script saved locally:
sudo ./docker_short_command.sh updateTo remove all shortcuts and cleanup your system:
sudo ./docker_short_command.sh uninstallDocker Short Command Help:
dhpEnter a container's shell:
dec my-container-name
decx my-container-nameView JSON configuration of a container:
ditj my-container-nameStart a specific profile in docker compose:
dup my-profileMade with β€οΈ for DevOps Engineers
Powered by DevOps In Action, this repository offers real-world, hands-on DevOps setups for CI/CD pipelines, containerization, Kubernetes, cloud platforms (AWS, GCP, Azure), and infrastructure at scale.
This guide is provided as-is for educational and professional use.
Feel free to suggest improvements or report issues.
Please star the repo and share it! Thanks a lot! π