Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to paste the selected filename into the copy popup, so when I hit F5 this filename will be in the 'to' section, so I can adjust it?

For example:

I want to copy /home/piotr/testFile.log to /home/piotr/testFile2.log.
I open both panels in the same directory and hit F5, but the 'to' value is: /home/piotr and I would like it to be /home/piotr/testFile.log, so I can simply adjust the name instead of typing it from the scratch.

share|improve this question
up vote 2 down vote accepted

Use Shift-F5 instead (or Shift-F6 for renaming) – the dialog will have the to field filled with current file's name (without the path).

Sadly those combinations not work in certain circumstances. No idea if it depends on MC build, terminal or some used library. So I also added this in ~/.mc/menu as an alternative:

5       Copy
        read -e -i "%f" -p 'Copy file : ' name
        [[ "$name" && "$name" != "%f" ]] && cp "%f" "$name"

6       Rename
        read -e -i "%f" -p 'Rename file : ' name
        [[ "$name" && "$name" != "%f" ]] && mv "%f" "$name"

Then I just select the file, hit F2, 5 (or 6 for renaming) then edit the name and press Enter. It requires bash 4 or newer, due to the read's -i option.

share|improve this answer
Works like a charm (at least in my build)! Much obliged. – Piotr Nowicki Feb 15 '12 at 10:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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