# Búsqueda y manipulación de texto

## grep

```shell
grep <word> <file>
# Expresiones regulares
grep -Ei "<word-1>|<word-2>|<word-3>" <file>
# Invertir filtro
cat /etc/passwd | grep -Eiv "/usr/sbin/nologin|/bin/false"
```

## sed

```shell
echo "hack the world" | sed 's/world/planet/'
```

## cut

```shell
cut -d ":" -f 1 /etc/passwd
```

## awk

```shell
echo "uno-dos-tres" | awk -F "-" '{print $1, $3}'
```

## tr

```shell
tr --delete '\n' < <file>
tr -d '\n' < <file>
tr -d '[[:space:]]' < <file>
```
