Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

How do I delete selected text in the nano editor?

I came across this issue while needing to delete the virtual host file and replace its content completely by other content. But the problem is that I can't select and delete the entire text at once. And if I delete it character by character, it won't be a computer thing.

share|improve this question

marked as duplicate by Eric Carvalho, rusty, Warren Hill, bodhi.zazen, Radu Rădeanu Jul 25 at 0:19

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.

    
No, It's not duplicate. I am particularly asking for deleting the selected content that is not available on link you are saying to be duplicate of. –  vaibhav Jul 22 at 11:10
    
your question seems to me like problem in editing a text, now I can understand that you are asking about selecting text using mouse and delete... see my answer... –  ARUL Jul 22 at 11:29
    
thanks @AJ. I accept i wasn't clear –  vaibhav Jul 22 at 11:35

1 Answer 1

up vote 7 down vote accepted

You can't select with mouse and delete text using nano editor. For faster delete you can use Ctrl + K to delete(cut) the present line of text.

Note : Ctrl + K will cut the line of text. Using Ctrl + U you can paste it.

EDIT: Additional Info from steeldriver

You can select and cut something other than the current line using Ctrl-^ to mark the start of the text, then advancing the cursor e.g. using Ctrl-F (forward one character) and/or Ctrl-Space (forward one word) and/or arrow keys, and then pressing Ctrl-K

share|improve this answer
2  
You can select and cut something other than the current line using Ctrl-^ to mark the start of the text, then advancing the cursor e.g. using Ctrl-F (forward one character) and/or Ctrl-Space (forward one word) and/or arrow keys, and then pressing Ctrl-K –  steeldriver Jul 22 at 11:45
    
like @steeldriver said.. that's how you delete in nano! First set the mark with Ctrl + ^, then select with arrow keys, use the cut Ctrl + K and to delete, don't follow that by a paste Ctrl + U;) To copy the key combo is Alt + ^ –  rusty Jul 22 at 12:09
    
So is the simple answer 'hold down the Backspace/Delete key?' :) +1 Very useful –  Wilf Jul 22 at 14:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.