Skip to main content
edited tags
Link
derobert
  • 113.4k
  • 20
  • 242
  • 289
Removed solved from title
Link
jasonwryan
  • 74.9k
  • 35
  • 204
  • 232

{SOLVED} how How do I delete files with spaces in them in bash script?

for better readibility giving hopefully a better understanding to one that wants to know how to do this
Source Link
uxserx-bw
  • 536
  • 3
  • 7
  • 24
  • oldname='filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3).mp3'

  • echo 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3' 'the hole name now is that ' filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3 the hole name now is that

  • echo

  • echo 'calling rm' 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3""' calling rm filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3""

  • rm 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3' rm: cannot remove `filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3': No such file or directory

  • echo

filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3)

filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3).mp3

  • oldname='filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3).mp3'

  • echo 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3' 'the hole name now is that ' filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3 the hole name now is that

  • echo

  • echo 'calling rm' 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3""' calling rm filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3""

  • rm 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3' rm: cannot remove `filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3': No such file or directory

  • echo

filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3)

filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3).mp3

  • oldname='filewith--lotsofspacesand____-----__&&???*#$$LSD----inthename(3).mp3'

  • rm 'filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3' rm: cannot remove `filewith--lotsofspacesand____-----&&???*#$$LSD----inthename(3).mp3': No such file or directory

edited title
Link
uxserx-bw
  • 536
  • 3
  • 7
  • 24
Loading
added 522 characters in body
Source Link
uxserx-bw
  • 536
  • 3
  • 7
  • 24
Loading
added 722 characters in body; edited title
Source Link
uxserx-bw
  • 536
  • 3
  • 7
  • 24
Loading
formatting
Source Link
manatwork
  • 32.1k
  • 8
  • 104
  • 93
Loading
Source Link
uxserx-bw
  • 536
  • 3
  • 7
  • 24
Loading