1/20/2024 0 Comments Iterm autocomplete suggestions![]() ![]() If you do that,Īccording to this blog post ("Bash Completion for Mac OS X"), the instructions are different for Mac OS X. If you insert the above three lines, minus their # characters, Presumably, the above will also work (for your user account) To disable it, all you need to do is re-comment each of the lines above (by adding a # to the start of each line). Alternatively, logout and login again, or just reboot. Please note: for the changes to take effect in existing terminals, /etc/bash.bashrc will need to be sourced. Save the file (you do this in nano by pushing Ctrl+ o and Enter, then Ctrl+ x to quit), and it should now work. Un-comment each of these lines (by removing the # prefix that each line has). Use the arrow keys to find these lines: #if then To do this with a command-line text editor like nano, execute the command sudo nano /etc/bash.bashrc (and if needed, enter your password). Instructions (Linux)įrom a terminal window, edit your system's bash.bashrc file. For clarity, I rewrote these instructions below in a more beginner-friendly manner. In Docker 1.12RC we get a native, built-in orchestration model called Swarm Mode.According to this page ("Turn on Bash Smart Completion") on Ubuntu Blog, it is as easy as editing your bash.bashrc file. If you have more hints and hacks for completion let me know in the comments. So I hope you found this useful - and I'm sure there are lots more ways you can take advantage of this. This even works with some of the crazy automatically generated container names that Docker can create. Here I type just the first letter and hit tab. Fortunately these commands also work with a few unique characters like below:ĩ9b9505c7c18e51b1154e7d95f0e034eac4c9264ff2196501208f fd35644c37c $ docker inspect 99b9įor when you want to be explicit about naming then tab-completion helps you out and will attempt to finish off the name or ID you started typing in. $ docker run -d -P nginxĩ9b9505c7c18e51b1154e7d95f0e034eac4c9264ff2196501208ffd35644c37cĬommands like docker inspect or docker kill take an ID or name as an input, so if you're new to Docker you would probably copy/paste the whole container ID. Here I run an nginx container and then forget to give it a name. ![]() Having done this myself I saw docker top - something brand new for me.ĭisplay the running processes of a container Now you can profit from doing things like this:Īttach events info network rename service unpauseīuild exec inspect node restart start updateĬommit export kill pause rm stats version Ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion ![]() Ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion Ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion bashrc file already then you may want to use chmod +x and to add an extra line at the top of the file #!/bin/bash cat > ~/.bashrc <<EOL bashrc file that is executed every time you open a terminal. We will run through the instructions here and show a couple of examples of what it looks like when configured. This little nugget was hidden away there. I learned this information by reading all the way to the bottom of the new Docker for Mac getting started page. Now if you're running the Docker Mac beta and you have brew installed too, then it only takes a few moments. You also have bash completion for when you're not sure what commands are available.ĭo I have bzip? What was it called again? $ bz I use this for laziness, so I get to type less and make fewer mistakes. If you are using a terminal every day then you probably hit tab after every few characters. Here's the kicker - it works for Docker too after running a few quick scripts. Bash completion is a kind of plug-in for your terminal that lets you auto-complete or auto-suggest what to type in next by hitting tab. I don't know how I've managed without this for so long. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |