Home Explore Blog CI



nushell

commands/docs/bytes_length.md
bb406b3718250e141923f8c0c86311fc0596c8973d0a3d90000000030000045c
---
title: bytes length
categories: |
  bytes
version: 0.104.0
bytes: |
  Output the length of any bytes in the pipeline.
usage: |
  Output the length of any bytes in the pipeline.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `bytes length` for [bytes](/commands/categories/bytes.md)

<div class='command-title'>Output the length of any bytes in the pipeline.</div>

## Signature

```> bytes length {flags} ...rest```

## Parameters

 -  `...rest`: For a data structure input, find the length of data at the given cell paths.


## Input/output types:

| input        | output    |
| ------------ | --------- |
| binary       | int       |
| list\<binary\> | list\<int\> |
| record       | record    |
| table        | table     |
## Examples

Return the length of a binary
```nu
> 0x[1F FF AA AB] | bytes length
4
```

Return the lengths of multiple binaries
```nu
> [0x[1F FF AA AB] 0x[1F]] | bytes length
╭───┬───╮
│ 0 │ 4 │
│ 1 │ 1 │
╰───┴───╯

```

Chunks
2129bc4d (1st chunk of `commands/docs/bytes_length.md`)
Title: bytes length: Determine the length of byte data
Summary
The `bytes length` command calculates and outputs the length of byte data within the pipeline. It can handle single binary inputs, lists of binaries, records, and tables, returning corresponding integer lengths.