Bash:查找文件末尾带有尾随空格的文件 [英] Bash: find files with trailing spaces at the end of the lines

查看:94
本文介绍了Bash:查找文件末尾带有尾随空格的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个bash命令来查找每行末尾带有空格的文件.我对删除空格不感兴趣,而对查找文件不感兴趣.

I'm looking for a bash command to find files with trailing spaces at the end of each line. I'm not interested in removing the spaces, but just in finding the files.

推荐答案

查找带有尾随空格的文件.

Find files that has trailing spaces.

find . -type f -exec egrep -l " +$" {} \;

这篇关于Bash:查找文件末尾带有尾随空格的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆