25 points

I really like that cd command. :P

permalink
report
reply
10 points

You’ll love zoxide then.

permalink
report
parent
reply
-2 points
*

It’s six letters. Can’t they just call it zd or something? Yeah sure, I can use aliases, but why complicate in the first place?

permalink
report
parent
reply
8 points

The command is ‘z’

permalink
report
parent
reply
2 points

On arch the command is just z

permalink
report
parent
reply
3 points

Hm I wonder, is it really a command? I thought it is just a function of the shell to change the working directory.

permalink
report
parent
reply
2 points

A command is anything you execute in the shell.

cd is just a built-in command

permalink
report
parent
reply
24 points

sudo !! to rerun last command as sudo.

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

permalink
report
reply
2 points

Fifth as in fifth most recent command or fifth oldest?

permalink
report
parent
reply
3 points
*

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.

permalink
report
parent
reply
17 points

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.

permalink
report
reply
3 points

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.

permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
3 points

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

permalink
report
parent
reply
3 points

Also, screen can connect to an UART device or serial or anything that offers up a TTY

permalink
report
parent
reply
2 points

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

permalink
report
parent
reply
1 point

Simply change your terminal command to execute the terminal multiplexer of your choice.

man terminal_of_choice, look for (start) command.

permalink
report
parent
reply
1 point

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

permalink
report
parent
reply
1 point

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?

permalink
report
parent
reply
16 points

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

permalink
report
reply
3 points

Even better when cd automatically invokes pushd.

permalink
report
parent
reply
17 points

cd - undoes the last cd. Not quite push/popd but still useful. Pro tip, works also: git checkout -

permalink
report
parent
reply
2 points

Hell yeah. Every one of these threads makes me more inclined to read man pages

permalink
report
parent
reply
1 point

what’s your alias?

permalink
report
parent
reply
15 points

sudo udevadm monitor

Figuring out which usb device went on holiday.

permalink
report
reply
5 points

Wow, super useful command. Starring this comment

permalink
report
parent
reply

Asklemmy

!asklemmy@lemmy.ml

Create post

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

Community stats

  • 9.2K

    Monthly active users

  • 3K

    Posts

  • 50K

    Comments