Thanks for your suggestion
well,I tried to do.Bit confused which one to delete in the file once i opened it.If something necessary contents are deleted then unexpected behavior will be happend
---------- Post updated at 08:45 AM ---------- Previous update was at 08:08 AM ----------
Hi All,
I created this file in another user directory.I just don't care what i need to do with the wrong data copied
# Move into the directory containing your files...
cd /root/.ssh
# Determine how many lines are in your corrupted file...
lines=$(wc -l < authorized_keys)
# Determine how many lines are in the file that was mistakenly added...
excess=$(wc -l < id_rsa.pub)
# Print directions...
printf 'authorized_keys contains %d lines.\n' $((lines))
printf 'id_rsa.pub contains %d lines.\n' $((excess))
printf 'Remove the last %d lines (starting with line #%d) from authorized_keys.\n' $((excess)) $((lines - excess + 1))