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

Asklemmy

47617 readers
995 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 5) 50 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 20 points 7 months ago

pv (Pipe Viewer) is a command line tool to view verbose information about data streamed/piped through it. The data can be of any source like files, block devices, network streams etc. It shows the amount of data passed through, time running, progress bar, percentage and the estimated completion time.

[โ€“] [email protected] 6 points 7 months ago* (last edited 7 months ago)

Getting cheatsheets via curl cheat.sh/INSERT_COMMAND_HERE

No install necessary, Also, you can quickly search within the cheatsheets via ~. For example if you copy curl cheat.sh/ls~find will show all the examples of ls that use find. If you remove ~find, then it shows all examples of ls.

I have a function in my bash alias for it (also piped into more for readability):

function cht() { curl cheat.sh/"$1"?style=igor|more }

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

less, watch

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

sudo !! to rerun last command as sudo.

history can be paired with !5 to run the fifth command listed in history.

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

Fifth as in fifth most recent command or fifth oldest?

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

compgen -back to see all valid things you can type into a shell.

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

Not a specific command, but I learned recently you can just dump any executable script into ~/bin and run it from the terminal.

I suffer greatly from analysis paralysis, I have a very hard time making decisions especially if there's many options. So I wrote a script that reads a text file full of tasks and just picks one. It took me like ten minutes to write and now I spend far more time doing stuff instead of doing nothing and feeling badly that I can't decide what to do.

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

This is because $HOME/bin is in your $PATH environment variable. You can add more paths that you'd like to execute scripts from, like a personal git repo that contains your scripts.

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

Ctrl-r with https://github.com/atuinsh/atuin is amazing. Never forget a command you used ever again.

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

I trigger it with the up arrow.

[โ€“] [email protected] 11 points 7 months ago (6 children)
load more comments (6 replies)
[โ€“] [email protected] 4 points 7 months ago
[โ€“] [email protected] 3 points 7 months ago (1 children)
load more comments (1 replies)
[โ€“] [email protected] 3 points 7 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.

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

Ctrl-R: (type something)

[โ€“] [email protected] 5 points 7 months ago* (last edited 7 months ago)

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

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

clear. Constantly, and for no reason.

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

I like it so much I alised it to c.

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

Oh. I know. But you don't understand - I'm compelled to type it out. I must.

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

I used to, but the terminal clear is better, so I don't.

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

Not a command as much as I press the up arrow a lot. I'm.pretty lazy and hitting the up arrow 12 times is easier then retyping a complex rsync command.

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

Install the fzf integration for ctrl+r fuzzy finding through your entire shell history:

https://thevaluable.dev/fzf-shell-integration/

load more comments (1 replies)
load more comments (3 replies)
load more comments
view more: โ€น prev next โ€บ