13

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.

top 18 comments
sorted by: hot top controversial new old
[-] mug9145@chat.maiion.com 6 points 2 years ago
[-] chaoticAnimals@programming.dev 1 points 2 years ago

Interesting :)

[-] mim 4 points 2 years ago

Taskwarrior.

[-] FiveAcres@programming.dev 4 points 2 years ago

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 1 points 2 years ago

Of those mentioned, this one intrigues me most. Thanks!

[-] attn_dfct_dev@programming.dev 4 points 2 years ago
  • scoop - closest to apt on Windows
  • yt-dlp - active fork of youtube-dl
  • neofetch - System information display
  • winfetch - Same as neofetch, but for windows
  • pandoc - Ultimate converter
  • ffmpeg - must have tool
  • taskwarrior - best task manager imho
[-] fallenpixel@programming.dev 3 points 2 years ago

Always partial to yq and jq. No easier way to interact with kubernetes outputs on the fly.

[-] RandomDevOpsDude@programming.dev 2 points 2 years ago

How I have never heard of yq, I'm unsure, but thank you as I'm sure it will make life easier

[-] Andy@programming.dev 2 points 2 years ago

I don't know about k8s work in particular, but I enjoy jello and yamlpath more than jq and yq.

[-] nevalem@programming.dev 2 points 2 years ago

Don't forget about fq!

[-] sisyphean@programming.dev 3 points 2 years ago

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.

[-] sirnak@lemmy.world 1 points 2 years ago

Why haven't I heard of this before?? Absolute gamechanger o_O

[-] RandomDevOpsDude@programming.dev 2 points 2 years ago* (last edited 2 years ago)

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

[-] gamma@programming.dev 2 points 2 years ago* (last edited 2 years ago)

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@programming.dev 2 points 2 years ago* (last edited 2 years ago)

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.

https://github.com/jeffkaufman/icdiff

[-] Andy@programming.dev 3 points 2 years ago* (last edited 2 years ago)

Another good one is riff (riffdiff on crates.io).

EDIT: for single-column view, that is

[-] cd_slash_rmrf@programming.dev 0 points 2 years ago

I recently learned about diffsitter which uses tree-sitter for meaningful diffs

[-] Algae@programming.dev 1 points 2 years ago* (last edited 2 years ago)

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 files
  • rg (ripgrep) for string searches
  • sd (sed) for search and replace
  • dust (dust) for information about my directories
  • lsd (aliased to ls or l) for replacing Dir
  • bat (better cat) - for when the help pages are too long

Other stuff I love:

  • htop - I just learned you can run this in WSL to see all your system cores. It's pretty!
  • nvim - obviously. The best vim. Even works in VSCode
load more comments
view more: next ›
this post was submitted on 15 Jun 2023
13 points (100.0% liked)

commandline

1819 readers
3 users here now

founded 2 years ago
MODERATORS