92
submitted 12 hours ago by [email protected] to c/[email protected]
top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 3 points 17 minutes ago

cd every single day.

[-] [email protected] 3 points 25 minutes ago

Sudo !!

It reruns the last command as sudo.

Pretty useful since I'm always forgetting.

[-] [email protected] 1 points 43 minutes ago

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

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

[-] [email protected] 1 points 1 hour ago
[-] [email protected] 7 points 3 hours ago

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.

[-] [email protected] 1 points 2 hours ago* (last edited 2 hours ago)

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 44 minutes ago

Is there something similar in fish shell?

[-] [email protected] 7 points 5 hours ago

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] 7 points 3 hours ago

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

[-] [email protected] 26 points 7 hours ago

sudo !! to rerun last command as sudo.

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

load more comments (2 replies)
[-] [email protected] 9 points 6 hours 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] 9 points 7 hours ago
[-] [email protected] 6 points 7 hours ago
[-] [email protected] 9 points 8 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.

[-] [email protected] 7 points 5 hours ago

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

[-] [email protected] 15 points 8 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.

[-] [email protected] 17 points 10 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.

[-] [email protected] 2 points 2 hours ago

Don’t use screen, but I do use tmux pretty heavily.

[-] [email protected] 3 points 3 hours ago

I recently switched to tmux and boy, it's way better. I basically use only tmux now anymore. Creating panes to have two processes in one glance, multiple windows, awesome. Plus all the benefits of screen.

[-] [email protected] 1 points 2 hours ago

Try zellij. Not as popular as tmux, but very intuitive to use.

[-] [email protected] 1 points 2 hours ago

Maybe someone reading wants to now about prefix+s. This doubles your excitement.

[-] [email protected] 1 points 2 hours ago

How does screen / tmux work when detached from a session, how does it keep the session alive (both when running locally, and while ssh:ing to a server)? Is there a daemon involved?

[-] [email protected] 3 points 5 hours ago

In a similar vein, nohup lets you send tasks to the background and seems to be everywhere.

load more comments (3 replies)
[-] [email protected] 7 points 8 hours ago
load more comments (3 replies)
[-] [email protected] 12 points 9 hours ago

clear. Constantly, and for no reason.

[-] [email protected] 11 points 9 hours ago
[-] [email protected] 13 points 8 hours ago

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

load more comments (1 replies)
load more comments (2 replies)
[-] [email protected] 3 points 6 hours ago* (last edited 6 hours 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] 15 points 10 hours ago

sudo udevadm monitor

Figuring out which usb device went on holiday.

load more comments (1 replies)
load more comments
view more: next ›
this post was submitted on 21 Sep 2024
92 points (97.9% liked)

Asklemmy

43407 readers
1348 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 5 years ago
MODERATORS