This is the first post of a series where I want to give tips and trick for the Terminal/CLI, have fun:
bat instead of cat
bat is a
cat replacement with some nice features:
- Syntax highlighting (the language can be specified)
- Git integration (shows additions, deletions, modifications)
- Automatic paging (can pipe its own output to less)
- File concatenation (in a non-interactive terminal, bat acts as a drop-in replacement for cat)
- Line numbering
- Ability to show non-printable characters like space, tab or newline
- Line highlighting (highlight the specified line ranges with a different background color)
- Text wrapping
If you want to use the original cat command:
command cat whatever.txt
Check out the readme and the man page, you can install it via
export BAT_STYLE='full' alias cat='bat'
exa instead of ls
exa is a replacement for ls with:
- Colored output
- Git status
- Tree view
alias la='ls -alh --git' alias ls='exa'
MultiTail is like tail but it allows you to print multiple files in multiple windows (with ncurses). It can colorize, filter and merge, check out the list of features, you can install it via
diff-so-fancy and delta
diff-so-fancy makes git diffs human readable.
Setup tip (
[pager] diff = diff-so-fancy | less --tabs=4 -RFX show = diff-so-fancy | less --tabs=4 -RFX
Setup tip (
delta --list-themes to see the themes, then:
[core] pager = delta --theme='ansi-dark' [interactive] diffFilter = delta --color-only
Check out the readme, so that you can see how to choose a theme (and also the potential issue with
bat), you can install it via
prettyping instead of ping
prettyping wraps ping and makes its output prettier: colorful, compact, easier to read and it shows live stats nicely.
htop instead of top
Hope you know htop, it’s an interactive process viewer, you can install it via
alias top='sudo htop'