Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to cp all data from one file to another empty one

Status
Not open for further replies.

mars19301

MIS
May 31, 2001
69
US
I created two data files and put the data in the wrong one and now I must copy from 1 to 2. Please excuse and tolerate this real basic newbie question. Besides I can't find the manual. Thanks you.

Jim
[bull]
 
mars19301,

I'm not exactly sure what you need to do, but if you want to copy file1 to file2, just type

cp file1 file2

or if you want to append to file2, try:

cat file1 >> file2

John
 
Do you mean you want to switch the two files?

If so, use mv to rename "file1" to "temp" or something, rename "file2" to "file1", and rename "temp" to "file2."

If not, elaborate on what you want to do; your post is very unclear.
 
It was clear to me. Isn't it usually? smile))). Anyway I want to empty one into the other because I loaded the data into the wrong file. I will trial and error these above suggestions. I will delete all data from file 1 once I have it copied to file 2. Thank you for your help. Maybe I can get a job writing presidential speeches.[bull]
 
When you don't need the old, wrong-filled file as empty file, and file2 didn't contain anything before, you would simply move (rename) it:

mv file1 file2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top