简体   繁体   English

如何识别大量文件的行尾

[英]How to identify line endings on a large number of files

Given a medium-size tree of files (a few hundred), is there some utility that can scan the whole tree (recursively) and display the name of each file and whether the file currently contains CRLF, LF, or mixed line terminators? 给定一个中等大小的文件树(几百个),是否有一些实用程序可以(递归)扫描整个树并显示每个文件的名称,以及该文件当前是否包含CRLF,LF或混合行终止符?

A GUI that can both display the current status and also selectively change specific files is preferred, but not essential. 既可以显示当前状态又可以有选择地更改特定文件的GUI是首选的,但不是必需的。

Also prefer a solution for Windows, but I have access to both Bash for Windows and a Linux box that has access to the same file tree, so I can use something Linux-y if necessary. 也更喜欢Windows的解决方案,但是我可以访问Windows的Bash和可以访问同一文件树的Linux机器,因此如有必要,我可以使用Linux-y。

Related Question: https://unix.stackexchange.com/questions/118959/how-to-find-files-that-contain-newline-in-filename 相关问题: https : //unix.stackexchange.com/questions/118959/how-to-find-files-that-c​​ontain-newline-in-filename

You can use linux' find to look recursivly for filenames containing newline characters: 您可以使用linux find来递归查找包含换行符的文件名:

find . -name $'*[\n\r]*'

From there you can proceed to do what you need to do. 从那里您可以继续做您需要做的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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