AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Iterm autocomplete suggestions11/1/2023 ![]() Pretty cool huh? If you’re using irb or another console type environment, you can use this same shortcut to give you a list of possible methods or autocomplete method names. Here I typed cd C, then pressed Tab twice, and Terminal gave me a list of all files or folders that start with the letter “C”. Now what I just learned was that if you press the Tab key twice, Terminal will show you a list of possible options. As a shortcut I can now press the Tab key, and Terminal will autocomplete the folder name: Then I started typing cd Fi to change the directory to “FiveMinuteChinese”. iTerm Preferences Profiles Colors Color presets Import Then again, Color presets you-color-scheme-name. You can see I typed ls to list the files and folders in the current location. You may already know that Terminal will autocomplete a file name or method name if you press tab after typing a portion of the word. You will have to press tab to complete the command you are currently typing. Alternatively you could use homebrew to install auto-completion for bash: brew install bash-completion. In Docker 1.12RC we get a native, built-in orchestration model called Swarm Mode.I accidentally found a really cool Terminal keyboard shortcut yesterday. One of its core features is smart auto-completion. 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
Read More
Leave a Reply. |