Home Explore Blog CI



nushell

commands/docs/bytes_ends-with.md
94c054974b33509f197880ee7da8fee1c82ae0815fa9b2f20000000300000456
---
title: bytes ends-with
categories: |
  bytes
version: 0.104.0
bytes: |
  Check if bytes ends with a pattern.
usage: |
  Check if bytes ends with a pattern.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `bytes ends-with` for [bytes](/commands/categories/bytes.md)

<div class='command-title'>Check if bytes ends with a pattern.</div>

## Signature

```> bytes ends-with {flags} (pattern) ...rest```

## Parameters

 -  `pattern`: The pattern to match.
 -  `...rest`: For a data structure input, check if bytes at the given cell paths end with the pattern.


## Input/output types:

| input  | output |
| ------ | ------ |
| binary | bool   |
| record | record |
| table  | table  |
## Examples

Checks if binary ends with `0x[AA]`
```nu
> 0x[1F FF AA AA] | bytes ends-with 0x[AA]
true
```

Checks if binary ends with `0x[FF AA AA]`
```nu
> 0x[1F FF AA AA] | bytes ends-with 0x[FF AA AA]
true
```

Checks if binary ends with `0x[11]`
```nu
> 0x[1F FF AA AA] | bytes ends-with 0x[11]
false
```

Chunks
1865242a (1st chunk of `commands/docs/bytes_ends-with.md`)
Title: bytes ends-with: Check if bytes end with a pattern
Summary
The `bytes ends-with` command in Nushell checks if binary data ends with a specified pattern. It takes a binary input and a pattern as arguments, returning `true` if the binary ends with the pattern and `false` otherwise. It can also be used with records and tables to check if the bytes at the given cell paths end with the specified pattern.