Problem background
After returning to the Windows side by line-by-line reading on the linux side through java, you will find the problem of missing newline characters. The reason is that the Unix system newline character is \n
and the Windows newline character is\r\n
Solution
import cn.hutool.core.io.FileUtil;
String content = FileUtil.readUtf8String(new File(filePath));
What you get is the text content