[Yandex Cloud documentation](../index.md) > [Billing with expense details by folder](index.md) > Managing labels

# Managing labels

Custom labels are pairs in the following format: `<label name>=<label value>`. You can label resources so that the [cost breakdown](get-folder-report.md#format) file gets a column named `label.user_labels.<label name>`. You can assigned multiple labels to each resource. 

For example, if all VMs belong to two projects, you can label each VM with `project=1` or `project=2`. The cost breakdown file will then get the `label.user_labels.project` column with the relevant values.

## Adding a label {#add-label}

{% list tabs %}

- CLI

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../cli/quickstart.md#install).
    
    Add a label to a service resource:
    
    ```bash
    yc <service name> <resource type> add-labels <resource name or ID> \
      --labels <label name>=<label value>
    ```

{% endlist %}

## Updating a label {#update-label}

{% list tabs %}

- CLI

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../cli/quickstart.md#install).
    
    {% note warning %}
    
    The existing labels (`labels`) will be completely overwritten by the ones you provide in your request.
    
    {% endnote %}
    
    Update a service resource label:
    
    ```bash
    yc <service name> <resource type> update <resource name or ID> \
      --labels <label name>=<label value>
    ```

{% endlist %}

## Deleting a label {#remove-label}

{% list tabs %}

- CLI

    If you do not have the Yandex Cloud CLI yet, [install and initialize it](../cli/quickstart.md#install).
    
    Delete a service resource label:

    ```bash
    yc <service name> <resource type> remove-labels <resource name or ID> \
      --labels <label name>
    ```

{% endlist %}

## Examples of label management {#examples}

### Adding a label

Adding a label to a VM:

```bash
yc compute instance add-labels cl123g4dridnn5cna6df-yduv --labels project=test
```
Result:

```yaml
done (5s)
id: fhm1pr2bu3p45s6ildh7
folder_id: b1g23ga45mev6cljderg
created_at: "2020-08-07T11:29:18Z"
name: cl123g4dridnn5cna6df-yduv
labels:
  project: test
zone_id: ru-central1-a
...
```

### Updating a label

Edit a Kubernetes cluster label:

```bash
yc managed-kubernetes cluster update k8s-gpu --labels new_lable=test_label
```

Result:

```yaml
done (1m36s)
id: cat1hknor2345e6d7rr8
folder_id: b1g23ga45mev6cljderg
created_at: "2020-08-07T11:15:59Z"
name: cluster
labels:
  new_lable: test_label
status: RUNNING
...
```

### Deleting a label

Delete a Managed Service for MySQL® cluster label:

```bash
yc managed-mysql cluster remove-labels mysql123 --labels my_lable
```

Result:

```yaml
id: c1qmjaatlurm2bcoi34i
folder_id: b1g23ga45mev6cljderg
created_at: "2020-08-20T11:53:20.015543Z"
name: mysql123
environment: PRODUCTION
...
```