this post was submitted on 07 Jun 2025
83 points (97.7% liked)

Linux

55067 readers
828 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
top 12 comments
sorted by: hot top controversial new old
[–] beeng@discuss.tchncs.de 2 points 3 days ago* (last edited 3 days ago) (5 children)

Now I have four ways to get to the begining and end of a command line. I can press Escape,^ or Ctrl+a for the begining of the line, and Escape,$ or Ctrl+e for the end of the line.

Bit suss on the ctrl-A start of line, because vim binding is A for append which is end of line.

[–] c10l@lemmy.world 3 points 2 days ago

Control-A and E should work in insert mode. That’s why OP mentions pressing escape before issuing the normal mode ^ and $ commands.

In insert mode, some or most of the EMacs-style shortcuts work.

[–] med@sh.itjust.works 8 points 3 days ago (1 children)

Ctrl +a and Ctrl +e for beginning and end of line are from Emacs.

GNU Readline is what provides them in the bash. There's a bunch of shortcuts worth learning in there!

Most distributions I've tried use Emacs as the default shell binding style, some of the bindings are even available in things like appliance cli's like Cisco IOS and clones.

Bash supports vi mode too, you just have to switch to it.

set -o vi

ZSH uses zle (ZSH Line Editor) instead of Readline, but I assume the Emacs style bindings have been copied over to zle for muscle memory portability. You can switch the keymap in zle,

bindkey -v

or set your own!

[–] beeng@discuss.tchncs.de 2 points 3 days ago

I am aware, explained more in my other comment

[–] atzanteol@sh.itjust.works 7 points 3 days ago (2 children)

ctrl+a and ctrl+e are from Emacs.

[–] FauxLiving@lemmy.world 3 points 2 days ago (1 children)

Is there an emacs key to 'delete this entire word'?

like if I'm using ls to look for a file, then I want to cat a file, I press up to get the previous command, ctrl+a to go to the beginning of the line and then spam d to delete letters. It's be much better if there was a 'delete until whitespace' button.

[–] coycoyoteyote@pawb.social 3 points 1 day ago* (last edited 1 day ago) (1 children)

M-d, aka alt+d

Generally in emacs ctrl+whatever operates on characters, while alt+whatever operates on words. For example, you can do ctrl+f/b to go forward/backword a character, and alt+f/b to go forward/backward a word.

[–] FauxLiving@lemmy.world 2 points 1 day ago

Oh yeah, that's way better. Thanks!

I'm using zsh and trying the emacs mode, that alt operates on words is the secret sauce I was looking for.

[–] beeng@discuss.tchncs.de 2 points 3 days ago

Yes but OP is using vi bindings for line navigation.

[–] SoulKaribou@lemmy.ml 2 points 2 days ago

Ctrl a and e are same as bash

[–] BananaTrifleViolin@lemmy.world 1 points 3 days ago (1 children)

Maybe I'm misunderstanding, but the commands would apply within the zsh, which is a bash alternative, not within the programmes running themselves?

Or are you saying its sus because its illogical/confusing to have opposite uses for tgebsame shirt cut? I can see that as people using a terminal and launching vim would constantly be working against "muscle memory" each time they switch which would be annoying! Being familiar with keyboard shortcuts is what can make terminal based workflows so fast.

[–] beeng@discuss.tchncs.de 0 points 3 days ago* (last edited 3 days ago)

It was a little strange in the "line movement" part they were talking about setting vim navigation on the cmd line and then putting Emacs style as aliases, of which I said it's a bit suss as it's too close to vim append.