---
title: bytes replace
categories: |
bytes
version: 0.104.0
bytes: |
Find and replace binary.
usage: |
Find and replace binary.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->
# `bytes replace` for [bytes](/commands/categories/bytes.md)
<div class='command-title'>Find and replace binary.</div>
## Signature
```> bytes replace {flags} (find) (replace) ...rest```
## Flags
- `--all, -a`: replace all occurrences of find binary
## Parameters
- `find`: The pattern to find.
- `replace`: The replacement pattern.
- `...rest`: For a data structure input, replace bytes in data at the given cell paths.
## Input/output types:
| input | output |
| ------ | ------ |
| binary | binary |
| record | record |
| table | table |
## Examples
Find and replace contents
```nu
> 0x[10 AA FF AA FF] | bytes replace 0x[10 AA] 0x[FF]
Length: 4 (0x4) bytes | printable whitespace ascii_other non_ascii
00000000: ff ff aa ff ××××
```
Find and replace all occurrences of find binary
```nu
> 0x[10 AA 10 BB 10] | bytes replace --all 0x[10] 0x[A0]
Length: 5 (0x5) bytes | printable whitespace ascii_other non_ascii
00000000: a0 aa a0 bb a0 ×××××
```
Find and replace all occurrences of find binary in table
```nu
> [[ColA ColB ColC]; [0x[11 12 13] 0x[14 15 16] 0x[17 18 19]]] | bytes replace --all 0x[11] 0x[13] ColA ColC
╭───┬──────────────┬──────────────┬──────────────╮
│ # │ ColA │ ColB │ ColC │
├───┼──────────────┼──────────────┼──────────────┤
│ 0 │ [19, 18, 19] │ [20, 21, 22] │ [23, 24, 25] │
╰───┴──────────────┴──────────────┴──────────────╯
```