Any extra tips or tricks are welcome!
Yesterday I learned that set -x enables trace for a bash, sh, or zsh script and prints the trace to the terminal.
Let's make a list of our favorite CLI utilities.
3 years ago by chaoticAnimals to c/commandline
Any extra tips or tricks are welcome!
Yesterday I learned that set -x enables trace for a bash, sh, or zsh script and prints the trace to the terminal.
Interesting :)
My answers (mostly running in powershell - not that it makes much of a difference!)
Rust-based utilities I couldn't live without:
fd (fd-find) for finding my filesrg (ripgrep) for string searchessd (sed) for search and replace dust (dust) for information about my directorieslsd (aliased to ls or l) for replacing Dirbat (better cat) - for when the help pages are too longOther stuff I love:
In Bash, I like to use cdargs
sudo apt-get install cdargs
It allows you to set up shortcuts on the fly,
cv sdbackup
rather than cd /media/user/Backup Plus/ MyFiles/current/sdbackup
cv with no argument will give you a list to select from current shortcuts
Of those mentioned, this one intrigues me most. Thanks!
I write a lot of bash scripts that end up running in automation in some fashion.
#!/usr/bin/env bash
set -euxo pipefail
Is pretty standard for me.
-e exit on error
-o pipefail exit on pipeline fail
-u error on unset variables
-x trace
Always partial to yq and jq. No easier way to interact with kubernetes outputs on the fly.
How I have never heard of yq, I'm unsure, but thank you as I'm sure it will make life easier
I'm a pretty big fan of icdiff. This utility allows you to compare two files to see what has been added or removed by using colorful fonts to highlight values.
I recently learned about diffsitter which uses tree-sitter for meaningful diffs
pv, which is like cat, simply copying files or stdin to stdout, but prints statistics to the terminal.
A related tip: dd isn't special in the way most people use it. This works too, if you're root: pv my-fav-distro.iso > /dev/sdc
go to feed...
go to feed...
Newsboat, an RSS reader https://newsboat.org/
save