how to delete a whole word on the right in Linux Bash Shell command line [duplicate]
This question already has an answer here:
On the bash command-line, how do you cut the word immediately after the cursor? [closed]
1 answer
how to delete a whole word on the right in Linux Bash Shell command line
such as this:
CTRL U = Delete left of the cursor
CTRL K = Delete right of the cursor
CTRL W = Delete word on the left
I want to know a shortcut to delete a whole word on the right, no matter where the cursor in the word, it just like in vim opt is:
daw
and I want to the same result in bash command line.
bash shortcut readline
marked as duplicate by Benjamin W.
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 29 '18 at 7:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
On the bash command-line, how do you cut the word immediately after the cursor? [closed]
1 answer
how to delete a whole word on the right in Linux Bash Shell command line
such as this:
CTRL U = Delete left of the cursor
CTRL K = Delete right of the cursor
CTRL W = Delete word on the left
I want to know a shortcut to delete a whole word on the right, no matter where the cursor in the word, it just like in vim opt is:
daw
and I want to the same result in bash command line.
bash shortcut readline
marked as duplicate by Benjamin W.
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 29 '18 at 7:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Please take a look at: What should I do when someone answers my question?
– Cyrus
Dec 29 '18 at 8:43
add a comment |
This question already has an answer here:
On the bash command-line, how do you cut the word immediately after the cursor? [closed]
1 answer
how to delete a whole word on the right in Linux Bash Shell command line
such as this:
CTRL U = Delete left of the cursor
CTRL K = Delete right of the cursor
CTRL W = Delete word on the left
I want to know a shortcut to delete a whole word on the right, no matter where the cursor in the word, it just like in vim opt is:
daw
and I want to the same result in bash command line.
bash shortcut readline
This question already has an answer here:
On the bash command-line, how do you cut the word immediately after the cursor? [closed]
1 answer
how to delete a whole word on the right in Linux Bash Shell command line
such as this:
CTRL U = Delete left of the cursor
CTRL K = Delete right of the cursor
CTRL W = Delete word on the left
I want to know a shortcut to delete a whole word on the right, no matter where the cursor in the word, it just like in vim opt is:
daw
and I want to the same result in bash command line.
This question already has an answer here:
On the bash command-line, how do you cut the word immediately after the cursor? [closed]
1 answer
bash shortcut readline
bash shortcut readline
edited Jan 2 at 13:50
VictorLee
asked Dec 29 '18 at 6:22
VictorLeeVictorLee
235
235
marked as duplicate by Benjamin W.
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 29 '18 at 7:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Benjamin W.
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Dec 29 '18 at 7:00
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Please take a look at: What should I do when someone answers my question?
– Cyrus
Dec 29 '18 at 8:43
add a comment |
Please take a look at: What should I do when someone answers my question?
– Cyrus
Dec 29 '18 at 8:43
Please take a look at: What should I do when someone answers my question?
– Cyrus
Dec 29 '18 at 8:43
Please take a look at: What should I do when someone answers my question?
– Cyrus
Dec 29 '18 at 8:43
add a comment |
2 Answers
2
active
oldest
votes
Try: Esc+
D or Alt+
D to delete word on the right.
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
add a comment |
You can try Ctrl + k
to delete from cursor to end of the line (all left side of the cursor), and Ctrl + u
to delete from cursor to start of the line (all right side of the cursor).
Also, I find this nice blog post covering a handful of bash shortcut, you may want to give it a read skorks.com
1
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try: Esc+
D or Alt+
D to delete word on the right.
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
add a comment |
Try: Esc+
D or Alt+
D to delete word on the right.
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
add a comment |
Try: Esc+
D or Alt+
D to delete word on the right.
Try: Esc+
D or Alt+
D to delete word on the right.
edited Dec 29 '18 at 10:15
double-beep
1,7032724
1,7032724
answered Dec 29 '18 at 6:38
tshionotshiono
2,022234
2,022234
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
add a comment |
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
This moves the word to the right of the cursor into a ring buffer. The last added element can be accessed via Ctrl+y. The possibly existing further elements in the ring buffer can then be called up via repeated Esc+y.
– Cyrus
Dec 29 '18 at 7:22
add a comment |
You can try Ctrl + k
to delete from cursor to end of the line (all left side of the cursor), and Ctrl + u
to delete from cursor to start of the line (all right side of the cursor).
Also, I find this nice blog post covering a handful of bash shortcut, you may want to give it a read skorks.com
1
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
add a comment |
You can try Ctrl + k
to delete from cursor to end of the line (all left side of the cursor), and Ctrl + u
to delete from cursor to start of the line (all right side of the cursor).
Also, I find this nice blog post covering a handful of bash shortcut, you may want to give it a read skorks.com
1
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
add a comment |
You can try Ctrl + k
to delete from cursor to end of the line (all left side of the cursor), and Ctrl + u
to delete from cursor to start of the line (all right side of the cursor).
Also, I find this nice blog post covering a handful of bash shortcut, you may want to give it a read skorks.com
You can try Ctrl + k
to delete from cursor to end of the line (all left side of the cursor), and Ctrl + u
to delete from cursor to start of the line (all right side of the cursor).
Also, I find this nice blog post covering a handful of bash shortcut, you may want to give it a read skorks.com
answered Dec 29 '18 at 6:53
Ahmad F. IksanAhmad F. Iksan
1
1
1
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
add a comment |
1
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
1
1
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
These two are already listed in the question itself, and the question is about deleting just a single word.
– Benjamin W.
Dec 29 '18 at 6:56
add a comment |
Please take a look at: What should I do when someone answers my question?
– Cyrus
Dec 29 '18 at 8:43