> For the complete documentation index, see [llms.txt](https://kashz.gitbook.io/kashz-jewels/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kashz.gitbook.io/kashz-jewels/tricks/file-modification.md).

# file modification

## regex

[Cheatsheet](https://cheatography.com/davechild/cheat-sheets/regular-expressions/)

```bash
.* : match everything.
(\s){2,}: 2 or more spaces
```

## sed

```bash
sed -i '/<SEARCH>/<REPLACE>/g' file
# -i: make changes in file
# -e: show output in terminal
# SEARCH: escape using '\'
# REPLACE: no escape
```

## cut

```bash
# using cut
cut -d DELIMITER -f FIELD

# to remove first string from text
cut -c2-
```

## awk

```bash
# TODO
```
