linux

bash

remove files with chinese character AND spaces

#./[机器学习]Introduction to Machine Learning.pdf
#./算法竞赛入门经典(第2版) (算法艺术与信息学竞赛).pdf

find . | grep -P '[\p{Han}]'|xargs -I '{}' rm "{}"

remove space in filename

prename is a perl rewrite of rename. On archlinux its called perl-rename and needs to be installed. Its prebuilt on debian:

find . -name '*.mkv' -exec prename 's/ +/_/g' {} +
This page was last modified: