70
submitted 7 hours ago by cybercitizen4@lemm.ee to c/asklemmy@lemmy.ml
top 50 comments
sorted by: hot top controversial new old
[-] huf@hexbear.net 1 points 4 minutes ago* (last edited 3 minutes 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

[-] papertowels@lemmy.one 9 points 2 hours ago

sudo !! to rerun last command as sudo.

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

[-] communism@lemmy.ml 1 points 1 hour ago

Fifth as in fifth most recent command or fifth oldest?

[-] papertowels@lemmy.one 1 points 17 minutes ago* (last edited 16 minutes ago)

I believe it's the fifth oldest - I think !-5 will get you the fifth impost recent, but I was shown that and haven't put it into practice.

The most common usecase I do is something like history | grep docker to find docker commands I've ran, then use ! followed by the number associated with the command I want to run in history.

[-] sgtnasty@lemmy.ml 3 points 1 hour 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.

[-] ripcord@lemmy.world 3 points 1 hour ago
[-] macattack@lemmy.world 2 points 1 hour ago* (last edited 1 hour 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 }

[-] potentiallynotfelix@lemdro.id 2 points 1 hour ago

less, watch

[-] Wuttin@lemmy.ml 3 points 1 hour ago
[-] Bougie_Birdie@lemmy.blahaj.zone 6 points 2 hours ago

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.

[-] unknowing8343@discuss.tchncs.de 1 points 9 minutes ago

I think the standard is ~/.local/bin, for the people that like standards.

[-] friend_of_satan@lemmy.world 11 points 2 hours 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.

[-] hit_the_rails@reddthat.com 6 points 3 hours ago
[-] sneezycat@sopuli.xyz 1 points 1 hour ago

I just aliased "sudo pacman -Syu && yay -Syu --aur" to "update" cause I got tired of writing it every day.

[-] MinFapper@startrek.website 1 points 7 minutes ago

You can just run yay with no arguments and it does exactly what your update script does.

[-] HeartyOfGlass@lemm.ee 11 points 4 hours ago

clear. Constantly, and for no reason.

[-] TankieTanuki@hexbear.net 2 points 1 hour ago

I like it so much I alised it to c.

[-] igorette@lemmy.ml 7 points 3 hours ago
[-] ripcord@lemmy.world 1 points 1 hour ago

CMD/CTRL-K for me.

[-] HeartyOfGlass@lemm.ee 8 points 3 hours ago

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

[-] ripcord@lemmy.world 1 points 1 hour ago

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

[-] 10_0@lemmy.ml 3 points 2 hours ago
[-] notfromhere@lemmy.ml 12 points 4 hours ago

Since nobody has said yet, I use screen pretty heavily. Want to run a long running task, starting it from your phone? Run screen to create a detachable session then the long running command. You can then safely close out of your terminal or detach with ctrl a, d and continue in your terminal doing something else. screen -r to get back to it.

[-] muzzle@lemm.ee 1 points 1 hour ago

I Always forget to run screen first, so I just rely heavily on dtach

[-] sgtlion@hexbear.net 3 points 3 hours ago

I would know this as tmux, is there a difference?

[-] huf@hexbear.net 1 points 2 minutes ago

no, tmux is a newer screen. some of us havent switched cos we're too lazy i guess? i think the common wisdom is that it's better. i havent tried cos i already know enough of screen and it's fine for me

[-] naught@sh.itjust.works 1 points 1 hour ago

gnu screen is just a different program than tmux. they do the same thing though

load more comments (1 replies)
[-] I_Miss_Daniel@lemmy.world 12 points 4 hours ago

sudo udevadm monitor

Figuring out which usb device went on holiday.

[-] tetris11@lemmy.ml 3 points 3 hours ago

Wow, super useful command. Starring this comment

[-] friend_of_satan@lemmy.world 2 points 2 hours ago* (last edited 2 hours ago)

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

[-] 1984@lemmy.today 2 points 2 hours ago

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

[-] eric@lemmy.ca 1 points 1 hour ago

I trigger it with the up arrow.

[-] BigLime@lemmy.ml 2 points 3 hours ago
[-] sneezycat@sopuli.xyz 2 points 1 hour ago

Get on with the times, install fastfetch ;)

[-] Jozav@lemmy.world 15 points 5 hours ago

pushd and popd to change directory and go back when done there.

load more comments (3 replies)
[-] emb@lemmy.world 21 points 6 hours ago

I really like that cd command. :P

load more comments (8 replies)
load more comments
view more: next ›
this post was submitted on 21 Sep 2024
70 points (98.6% liked)

Asklemmy

43408 readers
1084 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