Find files that contain BOM headers and clear BOM header commands under Linux

Source: Internet
Author: User

Locate the file that contains the BOM header, as follows:

Grep-r-i-l $ ' ^\xef\xbb\xbf './This command finds all the files that contain the BOM header in the current directory and subdirectories, and outputs the file name on the screen. However, the deletion of the BOM header, the Web-found commands are mostly not available, the more common command is: Grep-r-i-l $ ' ^\xef\xbb\xbf '/path | Xargs sed-i ' s/^\xef\xbb\xbf//;q ' but this command removes all rows except the first line, so it makes no sense. It is possible to test the following command: Find. -type f-exec sed-i ' s/\xef\xbb\xbf//' {} \; This command removes the BOM header from the current directory and all subdirectories.

Find files that contain BOM headers and clear BOM header commands under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.