Replace different wc in file?

dear all

i have case with 2 file different wc like:

filaA.txt
wc is 32121

fileB.txt
wc is 32130

now how to make fileA.txt same with fileB.txt??

thx before

 
cp fileB.txt fileA.txt

above command copies the contents of fileB to fileA.

is that your requirement ?

@itkamaraj
thx before your replay

not like that this condition

if fileB.txt in wc 32130 and fileA.txt wc is 32121
i want get wc 32130 - 32121=9 so i can tail -9 >file_last.txt and extract to file A with cat file_last.txt >> fileA.txt

or any now using diff???

Hi,

Just try this, using diff command.

fileA.txt
--------
1
2
3

fileB.txt
--------
1
2
3
4
5

Command
-----------

diff fileA.txt fileB.txt | grep ">" | sed 's/> //g' >> fileA.txt