diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/vagrant/cli%2Fport.html | |
new repository
Diffstat (limited to 'devdocs/vagrant/cli%2Fport.html')
| -rw-r--r-- | devdocs/vagrant/cli%2Fport.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/devdocs/vagrant/cli%2Fport.html b/devdocs/vagrant/cli%2Fport.html new file mode 100644 index 00000000..86afbecc --- /dev/null +++ b/devdocs/vagrant/cli%2Fport.html @@ -0,0 +1,16 @@ +<h1 id="port"> Port </h1> <p><strong>Command: <code>vagrant port [name|id]</code></strong></p> <p>The port command displays the full list of guest ports mapped to the host machine ports:</p> <div class="highlight"><pre class="highlight plaintext">$ vagrant port + 22 (guest) => 2222 (host) + 80 (guest) => 8080 (host) +</pre></div> +<p>In a multi-machine Vagrantfile, the name of the machine must be specified:</p> <div class="highlight"><pre class="highlight plaintext">$ vagrant port my-machine +</pre></div> +<h2 id="options"> Options </h2> <ul> <li> +<p><a href="#guest-port"><code>--guest PORT</code></a> - This displays just the host port that corresponds to the given guest port. If the guest is not forwarding that port, an error is returned. This is useful for quick scripting, for example:</p> <div class="highlight"><pre class="highlight plaintext">$ ssh -p $(vagrant port --guest 22) +</pre></div> +</li> <li> +<p><a href="#machine-readable"><code>--machine-readable</code></a> - This tells Vagrant to display machine-readable output instead of the human-friendly output. More information is available in the <a href="machine-readable">machine-readable output</a> documentation.</p> </li> </ul><div class="_attribution"> + <p class="_attribution-p"> + © 2010–2018 Mitchell Hashimoto<br>Licensed under the MPL 2.0 License.<br> + <a href="https://www.vagrantup.com/docs/cli/port.html" class="_attribution-link">https://www.vagrantup.com/docs/cli/port.html</a> + </p> +</div> |
