this post was submitted on 21 Sep 2024
219 points (96.6% liked)

Asklemmy

43945 readers
838 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
(page 3) 50 comments
sorted by: hot top controversial new old
[โ€“] alsimoneau@lemmy.ca 5 points 2 months ago* (last edited 2 months ago) (1 children)
load more comments (1 replies)
[โ€“] MadBob@feddit.nl 5 points 2 months ago (2 children)

I use "ping" every time I suspect my internet might be going a bit slow.

load more comments (2 replies)
[โ€“] kionite231@lemmy.ca 5 points 2 months ago (3 children)
load more comments (3 replies)
[โ€“] huf@hexbear.net 5 points 2 months ago* (last edited 2 months ago)
  • atools, which includes als, aunpack, apack. so you can stop caring about the kind of archive and just unpack it. it also saves you from shit archives that have multiple files/dirs in their root.
  • perl -e / perl -lne / ...
  • units
  • bc - a calculator that's actually good
  • pass - the only non-shit password store tool i've found so far. no gui, uses gpg and git to do the encrypting and storage/sharing
  • alias lr='ls -lrth' - so you can easily find the newest file, cos that's frequently what you want
  • unip - my script to look up things in the unicode db
  • find -type f -exec xzgrep 're' {} + - because xzgrep cant do -r

oh yeah, and for the shell readline, alt-b, alt-f, ctrl-w, ctrl-u, ctrl-k, ctrl-a, ctrl-e

[โ€“] toastal@lemmy.ml 5 points 2 months ago

GNU Parallel

[โ€“] z3rOR0ne@lemmy.ml 5 points 2 months ago* (last edited 2 months ago)

locate, from the mlocate package. So useful. Honorable mention goes out to tldr.

[โ€“] plumcreek@lemmy.ml 5 points 2 months ago (2 children)

qmv -f do ${dir}

... for quickly moving and renaming files. The default 'qmv' opens up your preferred text editor with a list of the source and destination name of the directory of files you want to move/rename. The '-f do' tells the command we only want to see/edit the [d]estination [o]nly. If you need to rename/move a bunch of files, it's much quicker to do it in vim (at least for me).

load more comments (2 replies)
[โ€“] FrostyCaveman@lemm.ee 4 points 2 months ago
[โ€“] drmoose@lemmy.world 4 points 2 months ago* (last edited 2 months ago)

I really like how nushell can parse output into it's native structures called tables using the detect command.

Unlike string outputs, tables allow for easy data manipulation through pipes like select foo will select foo key and you can filter and even reshape the datasets.

This is great if you need to work with large data pipes like kuberneters so you can do something like:

kubectl get pods --all-namespaces | detect columns | where $it.STATUS !~ "Running|Completed" | par-each { |it| kubectl -n $it.NAMESPACE delete pod $it.NAME }

This looks complex but it parses kubectl table string to table object -> filters rows only where status is not running or completed -> executes pod delete task for each row in parallel.

Nushell take a while to learn but having real data objects in your terminal pipes is incredible! Especially with the detect command.

There's are few more shells that do that though nu is the most mature one I've seen so far.

[โ€“] pyr0ball@sh.itjust.works 4 points 2 months ago* (last edited 2 months ago)

Going to shamelessly plug my custom bashrc setup which has a ton of little scripting helpers and a few useful aliases. Remember to clone recursively if you want to try it out. (Still very much a work in progress, but it's getting to be pretty robust)

https://GitHub.com/pyr0ball/PRbL-bashrc.git

[โ€“] BigLime@lemmy.ml 3 points 2 months ago (1 children)
load more comments (1 replies)
[โ€“] this@sh.itjust.works 3 points 2 months ago (1 children)

not sure if it counts as a command, but i use the up arrow to scroll through previous commands like, almost every time I open a terminal.

[โ€“] tetris11@lemmy.ml 5 points 2 months ago

Ctrl-R: (type something)

less, watch

load more comments
view more: โ€น prev next โ€บ