Skip to content

delete files with space characters in file name


When you delete files with space in file name, you will get file not found with rm command.

Using find

In this case, you can use find command to delete files with space in file name.

find . -name "* *" -type f -delete

Using Wildcards to Delete Files with Space Characters

rm file*spaces.txt

Table of contents

  1. License under CC BY-NC 4.0
  2. Copyright issue feedback, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No personal information is collected.