简体   繁体   中英

Special characters being added to linux file

In one of my box, I see special characters being added to "/etc/hosts" file. Not sure what is causing this. Any idea on how to debug this?

^@^@^@^@^@^@^@^@^@^@127.0.1.1    linux-host

You can try to use the lsof command to see what process opens the file. For example:

$ sudo lsof /bin/ping
COMMAND  PID USER  FD   TYPE DEVICE SIZE/OFF    NODE NAME
ping    4216 amit txt    REG    8,1    64424 1048708 /bin/ping

It will be trickier to catch it if the process doesn't keep the fd of the file open though...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM