summaryrefslogtreecommitdiff
path: root/devdocs/vagrant/cli%2Fport.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/vagrant/cli%2Fport.html
new repository
Diffstat (limited to 'devdocs/vagrant/cli%2Fport.html')
-rw-r--r--devdocs/vagrant/cli%2Fport.html16
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) =&gt; 2222 (host)
+ 80 (guest) =&gt; 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">
+ &copy; 2010&ndash;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>