Skip to content

delete files with space characters in file name

homepage-banner

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

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, 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.
Feedback