Bash: delete word ahead of cursorBash: delete from cursor till end of line with a keyboard shortcutDelete characters from cursor up to the beginningTerminal word navigation/deletionCursor positioning using mouse in bash possible?bash - wrong answer by word count commandBash: what is the meaning of $parameter##wordMoving to a word in bash in Emacs modeDelete lines with a word using sedHow can I delete from cursor to start in terminal (delete, not cut)bash script using espeak only says first word
Disable all sound permanently
What makes a character irredeemable?
What does the triangle look like in this diagram?
What's the global, general word that stands for "center tone of a song"?
Sending mail to the Professor for PhD, after seeing his tweet
How to "Start as close to the end as possible", and why to do so?
Airport Security - advanced check, 4th amendment breach
Parent asking for money after moving out
PhD Length: are shorter PhD degrees (from different countries) valued differently in other counter countries where PhD Is a longer process?
Why do Russians sometimes spell "жирный" (fatty) as "жырный"?
Why does `FindFit` fail so badly in this simple case?
Why do personal finance apps focus on outgoings rather than income
Lighthouse Alternatives
Can a passenger predict that an airline or a tour operator is about to go bankrupt?
Does Bank Manager's discretion still exist in Mortgage Lending
Manager told a colleague of mine I was getting fired soon
Principled construction of the quaternions
Nurikabe: Sixes
How to write a chemical equation for an reaction that is still fitting inside the document?
Would a horse be sufficient buffer to prevent injury when falling from a great height?
Can I cast Death Ward on additional creatures without causing previous castings to end?
What does a textbook look like while you are writing it?
Can anyone give me the reason why music is taught this way?
Did the Soviet army intentionally send troops (e.g. penal battalions) running over minefields?
Bash: delete word ahead of cursor
Bash: delete from cursor till end of line with a keyboard shortcutDelete characters from cursor up to the beginningTerminal word navigation/deletionCursor positioning using mouse in bash possible?bash - wrong answer by word count commandBash: what is the meaning of $parameter##wordMoving to a word in bash in Emacs modeDelete lines with a word using sedHow can I delete from cursor to start in terminal (delete, not cut)bash script using espeak only says first word
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
Consider the following bash command line, where ^ denotes the cursor location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
add a comment
|
Consider the following bash command line, where ^ denotes the cursor location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
2
Ctrl u
is an option for erasing from cursor location to beginning...
– nutty about natty
Apr 8 '13 at 15:23
23
Tryalt + d
, that might be useful, when emacs editing mode is set.
– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatanset -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.
– user76204
Apr 9 '13 at 9:25
add a comment
|
Consider the following bash command line, where ^ denotes the cursor location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
Consider the following bash command line, where ^ denotes the cursor location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
command-line bash shortcut-keys
command-line bash shortcut-keys
edited May 29 at 19:40
wjandrea
10.1k4 gold badges32 silver badges70 bronze badges
10.1k4 gold badges32 silver badges70 bronze badges
asked Apr 8 '13 at 15:12
Adam MatanAdam Matan
5,13419 gold badges59 silver badges87 bronze badges
5,13419 gold badges59 silver badges87 bronze badges
2
Ctrl u
is an option for erasing from cursor location to beginning...
– nutty about natty
Apr 8 '13 at 15:23
23
Tryalt + d
, that might be useful, when emacs editing mode is set.
– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatanset -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.
– user76204
Apr 9 '13 at 9:25
add a comment
|
2
Ctrl u
is an option for erasing from cursor location to beginning...
– nutty about natty
Apr 8 '13 at 15:23
23
Tryalt + d
, that might be useful, when emacs editing mode is set.
– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatanset -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.
– user76204
Apr 9 '13 at 9:25
2
2
Ctrl u
is an option for erasing from cursor location to beginning...– nutty about natty
Apr 8 '13 at 15:23
Ctrl u
is an option for erasing from cursor location to beginning...– nutty about natty
Apr 8 '13 at 15:23
23
23
Try
alt + d
, that might be useful, when emacs editing mode is set.– user76204
Apr 8 '13 at 16:20
Try
alt + d
, that might be useful, when emacs editing mode is set.– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatan
set -o emacs
enables it, but it is usually the default; if not, you can put that line in .bashrc
or .bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.– user76204
Apr 9 '13 at 9:25
@AdamMatan
set -o emacs
enables it, but it is usually the default; if not, you can put that line in .bashrc
or .bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.– user76204
Apr 9 '13 at 9:25
add a comment
|
2 Answers
2
active
oldest
votes
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
31
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment
|
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
4
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
2
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f279254%2fbash-delete-word-ahead-of-cursor%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
31
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment
|
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
31
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment
|
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
I answered similar question on unix.stackexchange.com:
Bash has readline commands that aren't bound by default. You can find
them at reference:
http://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html#Bindable-Readline-Commands
Command you are looking for is called "shell-backward-kill-word". You
have to select shortcut first. Let's use Crtl+p, since it's "previous
command" - same as up arrow.bind '"C-p": shell-backward-kill-word'
The only difference is you have to use "shell-kill-word" command instead, since you want to delete forward.
There is also a "kill-word" command with Meta+d shortcut (try Esc+d if you don't have Meta key). It will delete only one part of path at once.
edited Apr 16 at 0:55
Pablo A
4,1102 gold badges20 silver badges47 bronze badges
4,1102 gold badges20 silver badges47 bronze badges
answered Apr 10 '13 at 16:04
NykakinNykakin
3,22312 silver badges19 bronze badges
3,22312 silver badges19 bronze badges
31
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
add a comment
|
31
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
In short, add e.g. this to your $HOME/.inputrc file:"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)
– user964970
Jul 6 '17 at 10:17
31
31
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
Alt-d works for me
– ricab
Jan 20 '15 at 14:24
8
8
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
Generally, in the world of keyboards where Meta doesn't exist, Alt = Meta.
– Nate C-K
Mar 20 '15 at 3:49
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
I the world where you have many different keyboards, a convenient and fairly useful fact is that Esc as a prefix also acts as Meta.
– tripleee
Nov 30 '15 at 18:03
1
1
In short, add e.g. this to your $HOME/.inputrc file:
"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)– user964970
Jul 6 '17 at 10:17
In short, add e.g. this to your $HOME/.inputrc file:
"ew": shell-kill-word
, that will make Alt-w forward delete a word , much like CTRL-w backwards deletes a word (and unlike Alt-d which will forward delete but stop at e.g. a / or - and other characters)– user964970
Jul 6 '17 at 10:17
add a comment
|
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
4
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
2
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
4
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
2
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
Tested both the esc+d and alt/opt+d on OSX Mavericks and they work there as well.
edited Nov 30 '15 at 19:39
Gayan Weerakutti
2,23715 silver badges30 bronze badges
2,23715 silver badges30 bronze badges
answered Nov 30 '15 at 16:24
visyoualvisyoual
871 silver badge3 bronze badges
871 silver badge3 bronze badges
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
4
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
2
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
12
Option + d
gives me ∂ on OSX
– Ivan Balashov
Apr 16 '16 at 7:35
4
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra
– mfink
Aug 9 '18 at 17:42
2
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
12
12
Option + d
gives me ∂ on OSX– Ivan Balashov
Apr 16 '16 at 7:35
Option + d
gives me ∂ on OSX– Ivan Balashov
Apr 16 '16 at 7:35
4
4
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
-1 OSX is not Ubuntu. Feel free to add a comment, but this is not an answer.
– wjandrea
Sep 24 '16 at 16:37
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
you have to first enable the checkbox "use option as meta key" in the terminal preferences (profiles -> keyboard tab -> checkbox)
– nils petersohn
Apr 23 '18 at 16:15
control + d
on mac Sierra– mfink
Aug 9 '18 at 17:42
control + d
on mac Sierra– mfink
Aug 9 '18 at 17:42
2
2
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
@IvanBalashov if you are using iterm set your let opt key as esc+ . Under Profiles >keys
– tessie
Nov 27 '18 at 13:09
|
show 1 more comment
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f279254%2fbash-delete-word-ahead-of-cursor%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Ctrl u
is an option for erasing from cursor location to beginning...– nutty about natty
Apr 8 '13 at 15:23
23
Try
alt + d
, that might be useful, when emacs editing mode is set.– user76204
Apr 8 '13 at 16:20
@Mik how do you enable emacs mode?
– Adam Matan
Apr 9 '13 at 9:00
@AdamMatan
set -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.– user76204
Apr 9 '13 at 9:25