Solved

Copy lines from one file to another with mc

Posted on 2011-02-18
3
599 Views
Last Modified: 2012-05-11
Hi,
How can i use midnight commander to copy some lines from one file to another ?

Thanks!
0
Comment
Question by:Cristi_E
3 Comments
 
LVL 12

Expert Comment

by:mccracky
ID: 34927235
Why with mc?  Use bash.

Grab someline from somefile and append it to otherfile:

grep  someline somefile >> otherfile
0
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
ID: 34946235
If you wish to use MC, here's a way that should comply with most setups:

- in MC, press F9 for the menu, then select 'Options > Configuration' and make sure "Internal Editor" is selected
- Open the file you wish to copy from with F4
- Take the cursor to the beginning of the block you wish to copy, then press F3 for mark-up mode, then mark the block (or simply use the mouse for marking)
- Press CTRL + F, confirm to copy to the default temporary file "cooledit.clip"
- Close the source file
- Open the target file with F4
- Move the cursor to the paste location
- Press SHIFT + F5
- Confirm to paste from the default temp file "cooledit.clip"

Instead of using shortcuts, you could also just press F9 inside the editor to enter its pulldown menu, then use the File menu to copy/paste to file.
0
 
LVL 4

Author Comment

by:Cristi_E
ID: 34949569
Hi torimar,
It worked just great!

I thought this is a routine task in linux. I'm surprised to see that the answer has come with difficulty!

Thanks !
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need To Copy Terminal Window Text To Another Terminal Window 8 54
Recover Lacie Edmini data. 11 63
rsyslog raw message 4 35
sed/awk/tail: how to read 3'de last line 4 39
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question