<p>Is there any shorter alias on the kubectl/oc for deployments? In OpenShift you have deployment configurations and you can access them using their alias <code>dc</code>.</p>
<p>Writing <code>deployment</code> all the time takes too much time. Any idea how to shorten that without setting a local alias on each machine?</p>
<p>Reality:</p>
<pre><code>kubectl get deployment/xyz
</code></pre>
<p>Dream:</p>
<pre><code>kubectl get d/xyz
</code></pre>

<p>All of the above answers are correct and I endorse the idea of using aliases: I have several myself. But the question was fundamentally about shortnames of API Resources, like <code>dc</code> for <code>deploymentcontroller</code>.</p>
<p>And the answer to that question is to use <code>oc api-resources</code> (or <code>kubectl api-resources</code>). Each API Resource also includes any SHORTNAMES that are available. For example, the results for me of <code>oc api-resources |grep deploy</code> on OpenShift 4.10 is:</p>
<pre><code>➜oc api-resources |grep deploy
deployments                           deploy              apps/v1                                         true         Deployment
deploymentconfigs                     dc                  apps.openshift.io/v1                            true         DeploymentConfig
</code></pre>
<p>Thus we can see that the previously given answer of &quot;deploy&quot; is a valid SHORTNAME of deployments. But it's also useful for just browsing the list of other available abbreviations.</p>
<p>I'll also make sure that you are aware of <code>oc completion</code>. For example <code>source &lt;(oc completion zsh)</code> for zsh. You say you have multiple devices, so you may not set up aliases, but completions are always easy to add. That way you should never have to type more than a few characters and then autocomplete yourself the rest of the way.</p>
