What Are the Differences Between the grep Commands in HCE 2.0 and in CentOS 7?
Symptom
In HCE 2.0, when grep is used to search for binary files or files containing garbled characters, the message "Binary file xxx matches" is displayed. However, when searching for the same files in CentOS 7, the file content will be displayed.
Possible Cause
CentOS 7 uses grep 2.16, and HCE 2.0 uses grep 3.7. In version 2.22, the logic for processing garbled characters and binary files is changed. A different method is used to detect encoding errors and search for files.
Solution
Use grep -a instead of grep to search for files. Garbled characters and content in binary files will be treated as common characters.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot