Added batlog alias for reading logfiles

This commit is contained in:
nazdridoy 2024-02-22 03:17:23 +06:00 committed by GitHub
parent b35a74b73a
commit 4170d9b0f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -162,6 +162,16 @@ batgrep needle src/
```bash ```bash
tail -f /var/log/pacman.log | bat --paging=never -l log tail -f /var/log/pacman.log | bat --paging=never -l log
``` ```
You can also add an alias `batlog`` to read any logfile
```bash
alias batlog='bat --paging=never -l log'
tail -f /var/log/pacman.log | batlog
batlog /var/log/pacman.log
```
Note that we have to switch off paging in order for this to work. We have also specified the syntax Note that we have to switch off paging in order for this to work. We have also specified the syntax
explicitly (`-l log`), as it can not be auto-detected in this case. explicitly (`-l log`), as it can not be auto-detected in this case.