The find command's -delete flag removes files that are matched instead of displaying them. Remove the .swp files from the current directory:
$ find . -type f -name "*.swp" -delete
Linux Shell Scripting Cookbook - Third Edition
by Shantanu Tushar
Published by
Packt Publishing, 2017
The find command's -delete flag removes files that are matched instead of displaying them. Remove the .swp files from the current directory:
$ find . -type f -name "*.swp" -delete