Skip to content

Commit

Permalink
Create grep.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipebros authored Nov 8, 2023
1 parent c3ea0e5 commit a138f88
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions grep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
grep -v '^$' file.txt | sort | uniq
# Grep

## Contar quantidade de linhas de um arquivo que contenham essa string
```bash
grep -o 'prod\.ERROR.*Too many connections' laravel-2023-10-31.log | wc -l
```

## Abrir no less as linhas que contenham essa string
```bash
grep -o 'prod\.ERROR.*' laravel-2023-11-01.log | less
```

## Gerar um arquivo de texto com as linhas únicas e ordenadas alfanumericamente
```bash
grep -o 'prod\.ERROR.*' laravel-2023-11-01.log | uniq | sort > teste.log
```

0 comments on commit a138f88

Please sign in to comment.