Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
08-11-2005, 03:39 AM
|
#1
|
Member
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Rep:
|
midnight commander file rename ques
Over the past months I've been using MC alot, but despite reading the help files I haven't worked out the following thing.
When renaming a file and in dual directory view*, I press F6 to move/rename and the dialog box gives the lefthandside directory path by default.
Yep, that's great when you want to move files, but for simple renaming, it means having to type out the new name by hand. With so many files to rename, I'd prefer to be able to simple handedit the original name and have some typical edit key binding available (say the bash ones). i.e. I'd like the the original name to appear instead of the destination directory path, with the bash keybindings.
I've looked at the various mc config files and I can see this setting anywhere. Anybody understand the problem?
In fact, it's easier to do it in simple bash, but that lacks the visual panoramic view MC gives you.
Can anybody help?
* When writing that, it occurred to me that if I try another view in MC, it may just give me what I'm looking for. I'm going to try that now. And because I still haven't got cygwin working on my xp pro, I have to logout out totally for this and stick in a live cd. Will report back tho ...
|
|
|
08-11-2005, 07:49 AM
|
#2
|
Member
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Original Poster
Rep:
|
solved while writing LQ ques
Yes, I managed to get an instance of MC going, and my suspicion is true.
In MC, if you have the two directory view on , F6 will expect you to send the file to the other directory and will have the 2nd directory printed out in the dialog box waiting for you to simply type <return>, which makes it very easy, as long as you're moving files.
If, however, you change the view to info view, the F6 will assume you are renaming and stick in the original file name as I wanted. <ctrl>+a and <ctrl> works on this line.
So that's it! Cripes! that simple! The thought crossed my mind as I wrote it out and there you go, solved while writing. It appears to me that the act of writing out a question - carefully mind - in LQ sometimes leads you to self-solve it.
I wonder how many other people find that. It would be intersting to do a poll on the ways in which people finally have their linux questions solved.
I still ahev a whole load not solved .. including a locale one .. which I resusitated recently and it still ran into a cul-de-sac. Enfin, c'est la vie!
|
|
1 members found this post helpful.
|
08-11-2005, 12:13 PM
|
#3
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
But you really need to get cygwin working on XP Pro. 
|
|
|
08-11-2005, 03:50 PM
|
#4
|
Member
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Original Poster
Rep:
|
doggawn! drat!
who are you? How come, like, you *know*?
Back to those cygwin mailing lists ... sigh! "tell us when you find the solution to your that particular error report" etc etc.
:-D
|
|
|
08-17-2005, 05:21 PM
|
#5
|
Member
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Original Poster
Rep:
|
turns out that I´ve posted some superior spurious drivel about renaming in midnight commander.
That underlying logic doesn´t exist.
It's some sort of config setting, but it's going to take me a while longer to find out.
The"default destination field" when using F6 Ren/Move is what's at issue here but I can't seem to detect the setting for it in the mc.ext, mc.ini files. It might go by a different name.
At this stage I have to go to the sources to see how I can affect this F6 "default destination field". Now it starts to get complicated.
Renaming and moving seem to be totally synonomous in MC. In user terms, they aren't. Oh crap I can just see myself self spending hours on end trying to discover how to implement this tiny improvement.
|
|
|
08-17-2005, 06:39 PM
|
#6
|
Gentoo Developer
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Rep:
|
F4 to edit F9 to pull down then save as, then F8 to deleate the first one if you want to.Thats how I do it may be a better way ...
|
|
|
08-19-2005, 02:50 PM
|
#7
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
There is also the user menu: <F9> Command then select Edit menu file then select [Home]. At the top there is the user command that looks something like this:
Code:
+ t t
@ Do something on the tagged files
set %t; CMD=%{Enter command}
while [ -n "$1" ]; do
$CMD "$1"
shift
done
So if you have a rename command which mose distros do just change the {Enter command} to {rename}. Now you can rename files by hitting <F2> then @. If you don't have rename then go to freshmeat and pick one you like.
<edit> Sorry don't change {Enter command} as that is only a prompt. You just need to enter the rename command and arguments in the popup text box when you hit <F2> then @. I must be tired.
Last edited by /bin/bash; 08-19-2005 at 03:29 PM.
|
|
|
08-19-2005, 03:09 PM
|
#8
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
I would suggest the rename out of the slackware distro. You'll find it in the util-linux package
Just pull out the rename binary and put it in /usr/bin and pull out the rename.1.gz file and put it in /usr/man/man1.
Last edited by /bin/bash; 08-19-2005 at 03:10 PM.
|
|
|
08-20-2005, 03:11 AM
|
#9
|
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802
Rep:
|
Looking at my above posts, I'm not sure I made clear what I'm trying to say. Within mc you have the ability to input a command of your choosing by typing <F2> then @. The command will be executed against each file selected, one at a time. If you want to customize this you can edit the user menu which is located at ~/.mc/menu
Code:
+ t t
@ Do something on the tagged files
set %t; CMD=%{Enter command}
while [ -n "$1" ]; do
$CMD "$1"
shift
done
For instance If you want to cut down on typing so you don't have to type in rename each time you can put the rename command before the $CMD and all you would have to do is input the parameters. e.g.
Code:
+ t t
@ Rename the tagged files
set %t; CMD=%{Enter from to}
while [ -n "$1" ]; do
rename $CMD "$1"
shift
done
Now suppose you have a file listing like such:
$ ls -1
file1.txt
file10.txt
file2.txt
file3.txt
file4.txt
file5.txt
file6.txt
file7.txt
file8.txt
file9.txt
Arrgh! They're out of order. So in mc select file1.txt - file9.txt and do this:
<F2> @
In message box type this:
file file0 <- thats a zero:
Now if you list the directory they are all in order.
$ls -1
file01.txt
file02.txt
file03.txt
file04.txt
file05.txt
file06.txt
file07.txt
file08.txt
file09.txt
file10.txt
|
|
|
10-24-2012, 02:52 PM
|
#10
|
LQ Newbie
Registered: Oct 2012
Location: Argentina
Distribution: Ubuntu - Knoppix
Posts: 23
Rep: 
|
Thanks, Stabu!
Your solution works well. I rewrite it:
1. F9 / 2. Enter / 3. Info / 4. Select the file / 5. F6 / 6. Write the new name / 7. Enter
|
|
|
02-01-2013, 09:57 PM
|
#11
|
LQ Newbie
Registered: Aug 2009
Location: China
Distribution: ubuntu
Posts: 11
Rep:
|
I just found a much simpler method: Shift + F5/F6. It keeps the original file name. Hope it helps.
There's even a ticket for this feature on MC's project page, despite that the feature is already there. I think they really should improve their manuals and tutorials.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 12:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|