Docker Tips: Save Time with this Quick Typing Hack
I discovered this typing hack while attending DockerCon last year, where a Docker engineer performed a demo.
I'm a big fan of saving time, especially when it comes to typing, and I was instantly shocked to see this time-saver. I have yet to find this documented somewhere, so it's best to share this knowledge, right?
Have you ever had to type or copy a bunch of IDs for either a container or an image?
In the Hello World example below, you see the Hexadecimal number 690ed74de00f in the output of $ docker ps.
hello-world latest 690ed74de00f 4 months ago 960 B
Instead of copying or typing the entire ID number, type only the first two characters. In the example above, just typing 69 and "tab" in a docker command will fetch your results.
$ docker inspect 69
In the event you have two containers or images with the same first 2 characters, if you do, it's best to go buy a lottery ticket right away and type one more character. That's it I just saved you from having to type the extra 10 characters or copying and pasting.
Follow me
If you liked this article, Follow Me on Twitter to stay updated!