Let's make a list of our favorite CLI utilities.
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.
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.
attn_dfct_dev,
mim, Taskwarrior.
FiveAcres, 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
dark776174657273, Of those mentioned, this one intrigues me most. Thanks!
RandomDevOpsDude, (edited ) 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
fallenpixel, Always partial to yq and jq. No easier way to interact with kubernetes outputs on the fly.
Andy, I don't know about k8s work in particular, but I enjoy jello and yamlpath more than jq and yq.
nevalem, Don’t forget about fq!
RandomDevOpsDude, How I have never heard of yq, I'm unsure, but thank you as I'm sure it will make life easier
Algae, (edited ) 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 replacedust
(dust) for information about my directorieslsd
(aliased to ) for replacingDir
bat
(better cat) - for when the help pages are too longOther stuff I love:
sisyphean, I really like jless. You can pipe the JSON output of a cURL command into it and it displays it in a really nice, easy to read way with collapsible arrays and objects.
cd_slash_rmrf, if you spend a lot of time in the shell, i like using the following for easier directory traversal:
- fzf and its shell bindings for fuzzy-matching arguments
- https://github.com/rupa/z for jumping to "frecent" directories
- https://github.com/agkozak/zsh-z (a native zsh port of
z
)- https://github.com/Tarrasch/zsh-bd for going back directories
and some zsh settings which make
cd
silently act likepushd
/popd
:# autopushd : make cd act like pushd (alias doesn't work properly) # pushdminus : use -1 instead of +1 # pushdsilent : prevents printing stack on each cd # pushdtohome : `pushd` to ~/ # pushdignoredups : dont add duplicates to stack
gamma, I want to add
setopt autocd
, andhash -d name=/some/long/path/to/name
to create your own~name
shortcuts.
cd_slash_rmrf, woa, i didn't even know about
hash -d name=/path
, neat!
gamma, 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
chaoticAnimals, 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.
cd_slash_rmrf, I recently learned about diffsitter which uses tree-sitter for meaningful diffs
chaoticAnimals, Nice. Ty!
Andy, Another good one is riff (riffdiff on crates.io).
EDIT: for single-column view, that is
Add comment