This is a cache of https://docs.openshift.com/container-platform/4.3/cli_reference/openshift_cli/configuring-cli.html. It is a snapshot of the page at 2024-11-23T02:13:32.757+0000.
Configuring the <strong>cli</strong> - OpenShift <strong>cli</strong> (oc) | <strong>cli</strong> tools | OpenShift Container Platform 4.3
×

Enabling tab completion

After you install the oc cli tool, you can enable tab completion to automatically complete oc commands or suggest options when you press Tab.

Prerequisites
  • You must have the oc cli tool installed.

Procedure

The following procedure enables tab completion for Bash.

  1. Save the Bash completion code to a file.

    $ oc completion bash > oc_bash_completion
  2. Copy the file to /etc/bash_completion.d/.

    $ sudo cp oc_bash_completion /etc/bash_completion.d/

    You can also save the file to a local directory and source it from your .bashrc file instead.

Tab completion is enabled when you open a new terminal.