Exchange contents in two files without copying

62 Views Asked by At

I want to exchange the contents in two files A and B. However, I do not want to use copy operation such as C <- A; A <- B; B <- C;

In fact, I want to exchange contents of a hard disk page p1 in file A with contents of a hard disk page p2 ini file B. Theoretically, in this case, I only need to exchange two "pointers" that point two these two page.

I'm no deep in operating system. I want to know how to do this or can anyone give some suggestions about which content I need to refer to ?

The operating system is Linux.

1

There are 1 best solutions below

2
On

You do it at the shell:

mv a c   
mv b a
mv c b