this post was submitted on 21 Sep 2024
218 points (97.0% liked)

Asklemmy

47617 readers
939 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_[email protected]~

founded 6 years ago
MODERATORS
(page 4) 50 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 5 points 7 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)
[โ€“] [email protected] 8 points 7 months ago
[โ€“] [email protected] 41 points 7 months ago (1 children)

tldr because I am too impatient to read through man pages or google the exact syntax for what I want to do.

[โ€“] [email protected] 27 points 7 months ago (7 children)

There are exactly three kinds of manpages:

  1. Way too detailed
  2. Not nearly detailed enough
  3. There is no manpage

I will take 1 any day over 2 or 3. Sometimes I even need 1, so I'm grateful for them.

But holy goddamn is it awful when I just want to use a command for aguably its most common use case and the flag or option for that is lost in a crowd of 30 other switches or buried under some modal subcommand. grep helps if you already know the switch, which isn't always.

You could argue commands like this don't have "arguably most common usecases", so manpages should be completely neutral on singling out examples. But I think the existence of tl;dr is the counterargument.

Tangent complaint: I thought the Unix philosophy was "do one thing, and do it well"? Why then do so many of these shell commands have a billion options? Mostly /s but sometimes it's flustering.

load more comments (7 replies)
[โ€“] [email protected] 16 points 7 months ago (1 children)
load more comments (1 replies)
[โ€“] [email protected] 36 points 7 months ago (1 children)

Sudo !!

It reruns the last command as sudo.

Pretty useful since I'm always forgetting.

load more comments (1 replies)
[โ€“] [email protected] 8 points 7 months ago (1 children)

Seems like an appropriate place to share https://github.com/agarrharr/awesome-cli-apps

I'm a fan of ripgrep and lsd in particular.

load more comments (1 replies)
[โ€“] [email protected] 13 points 7 months ago (2 children)
load more comments (2 replies)
[โ€“] [email protected] 9 points 7 months ago* (last edited 7 months ago) (1 children)

Not a command but bang expansions. For example !? is the args of last command useful for stuff like mkdir foo ; cd !?

https://www.redhat.com/sysadmin/bash-bang-commands learn these. you suck at using your computer if you don't know them.

[โ€“] [email protected] 1 points 7 months ago

Is there something similar in fish shell?

[โ€“] [email protected] 36 points 7 months ago (2 children)

control+R

in bash, it lets you quickly search for previously executed commands.

its very useful and makes things much quicker, i recommend you give it a try.

load more comments (2 replies)
[โ€“] [email protected] 16 points 7 months ago (5 children)

CTR + u will delete the whole command. I use that a lot so I don't have to backspace. It's saved me a ton of time

[โ€“] [email protected] 17 points 7 months ago

Related: Alt + ., to cycle through arguments used in previous commands

load more comments (4 replies)
[โ€“] [email protected] 5 points 7 months ago* (last edited 7 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

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