get rid of files and directories with spaces in them

Kevin J. Cummings cummings at kjchome.homeip.net
Sat Jul 21 02:45:22 UTC 2007


Scott Berry wrote:
> How does one get rid of files and directories with spaces in them?  I
> tried rm and it doesn't want to remove the files or folders?

Quoting names with spaces works well.  So does use of the \ character to
escape the space.  Exact usage might vary depending on which shell
you're using.

The following examples should work well with bash:

	rm "filename with spaces"
        rm another\ file\ with\ spaces

When all else fails, wildcards can be your friends.

> Scott

-- 
Kevin J. Cummings
kjchome at rcn.com
cummings at kjchome.homeip.net
cummings at kjc386.framingham.ma.us
Registered Linux User #1232 (http://counter.li.org)




More information about the users mailing list