> For the complete documentation index, see [llms.txt](https://hossainemruz.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hossainemruz.gitbook.io/notes/kubernetes/untitled/commands/list.md).

# List

### List all resources and subresources of cluster

```bash
_list=($(kubectl get --raw / | grep "^    \"/api" | sed 's/[",]//g'))
for _api in ${_list[@]}; do
    _aruyo=$(kubectl get --raw ${_api} | jq .resources)
    if [ "x${_aruyo}" != "xnull" ]; then
        echo
        echo "===${_api}==="
        kubectl get --raw ${_api} | jq -r ".resources[].name"
    fi
done
```
