by the below command: find . -type f -name '*.rst' -exec sed --in-place 's/[[:space:]]\+$//' {} \+ Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>