What's an easy way to edit a multiline bash command?

https://lemmy.world/post/74644

What's an easy way to edit a multiline bash command? - Lemmy.world

Hello there :) As far as I know (searched through the web), editing/navigating a multiline in bash is not possible and opening nano, pasting and editing is to much friction I want to get rid off. Do you have any way to speed up the process? example of multiline: echo deb [arch=“$(dpkg --print-architecture)” signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian [https://download.docker.com/linux/debian] “$(. /etc/os-release && echo “$VERSION_CODENAME”)” stable" | Thank you :)

Personally if its just a bash command then I dont bother with formatting and just do one-liners. If I want it to look pretty then I’ll put it in a script. If I need to edit something you can use shortcuts like these to jump around the command line to edit whatever you need
Jump to a word in a command in Bash

Consider: ssh -i "key.pem" [email protected] Is there a quick way to jump to the beginning of "root" in such a Bash command in the terminal, without iterating over every word/cha...

Stack Overflow