One command I use a lot when working with Docker, is docker ps -a to see what containers I have and which ones are active. To save a little time when entering that command, create an alias in your BASH profile for that command.
- From a command prompt, change to your home folder: cd ~
- Edit the .profile file with a text editor. In my case, I use NANO: nano ./.profile
- Add this line to the end of the file: alias dpa=”docker ps -a”
- Save the file with CTRL-O and exit back to a command prompt with CTRL-X.
- Logout and log back in.
- At a command prompt enter: dpa. You’ll see the results of docker ps -a but without all the typing!