DEV Community

Alex
Alex

Posted on

Answer: shortcut for typing kubectl --all-namespaces everytime

Is there any alias we can make for all-namespace

Based on this excellent SO answer you can create alias that inserts arguments between prefix and suffix like so:

alias kca='f(){ kubectl "$@" --all-namespaces -o wide;  unset -f f; }; f'

and then use it regularly like so:

kca get nodes

Top comments (0)