You get a bonus - 1 coin for daily activity. Now you have 1 coin

PuTTY: Working with the Clipboard (Including Inside MC / Midnight Commander)

Practice



Probably every system administrator who spends time in PuTTY managing *nix servers or machines, whether Linux or BSD, has wondered at some point - how do you copy to or paste from the clipboard in it?

In the shell, the usual method worked: Ctrl+C on a highlighted section and the right mouse button to paste. But in Midnight Commander, for example, this method no longer works.

So let's take a look at how to properly work with the clipboard in PuTTY, in a way that works both in a bash or sh command line and in your favorite MC. In this case, the clipboard will also be accessible from Windows - i.e. whatever you copied from the PuTTY window will be available in any Windows application. And vice versa.


1. Method one: copying from any application into PuTTY

Copying to the clipboard

To do this:

  • Press and hold Shift
  • Select a section of text with the left mouse button
  • Release the left mouse button and Shift


The text is copied to the clipboard.


Pasting from the clipboard

  • To do this
  • either press Shift+INS
  • or press Shift+right mouse button

2. Method two, using the built-in clipboard of the built-in text editor (not accessible from other applications)

this method lets you copy between file texts within PuTTY itself

1. Select the desired text

2. In the Edit menu, choose Copy to Clipboard File

3. Close the editor

4. Open the other file you want to paste the text into

5. Move the cursor to where you want to paste the text

6. Open the Edit menu and choose Paste from Clipboard File

PuTTY: Working with the Clipboard (Including Inside MC  Midnight Commander)

PuTTY: Working with the Clipboard (Including Inside MC  Midnight Commander)

Comments

Кнт 31-10-2020
это реально работает и экономит мне мого времени при работе с файлами конфигурации.
Hamster 31-10-2020
Реально выручил, братишка!!! 1й способ работает! Это экономит много времени при написании конфигов! Спасибо!!!!
unxed 07-08-2020
Ещё одна опция: перейти с комбинации putty mc на putty4far2l far2l, и получить нормально работающий буфер обмена в терминале :)

Там даже два режима будет: локальный, когда на сервере отдельный буфер обмена, а на клиенте отдельный, и синхронизированный, когда один и тот же буфер и там и там доступен. При первом доступе к буферу обмена выбрать режим нужно будет.
admin 17-11-2019
Еще есть способ копировать через блок (типа буфера обмена только через файл)

1 переключиться в режим выбора блока нажатием F3
2 выберите блок (подсвечиваться белым)
3 отключить режим выбора блока с помощью F3
4 нажмите Ctrl F, чтобы открыть диалоговое окно Сохранить блок
5 нажмите Enter, чтобы сохранить его в папке по умолчанию
6 откройте другой файл в редакторе и перейдите к месту назначения
7 нажмите Shift F5, чтобы открыть диалог вставки файла
8 нажмите Enter, чтобы вставить из файла по умолчанию (который совпадает с тем, что в диалоговом окне Сохранить блок)
sam 15-11-2019
Вот такого не знал. Очень выручило. На МАС-овской клавиатуре нет инсерта. Приходилось страдать
))
Misha 29-10-2019
Вася, у мене все працює.
Вася 16-12-2018
Ты сам то пробовал ???

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "LINUX operating system"

Terms: LINUX operating system