1

This question already has an answer here:

I have some podcasts on my radio server which contain a timestamp when they should be played. I noticed one of them is put into single quotes 'filename.mp3', and I'm unable to remove them. Check this:

4,0K drwxr-xr-x 2 user group 4,0K  4. Apr 20:40 .
4,0K drwxrwsr-x 6 user group 4,0K  4. Apr 20:28 ..
 83M -rw-r--r-- 1 user group  83M  4. Apr 20:32 2016-03-09-22-00-moshtrocity.mp3
173M -rw-r--r-- 1 user group 173M  4. Apr 20:40 2016-03-25-10-00-funkfabrik-classic-25.mp3
 53M -rw-r--r-- 1 user group  53M  4. Apr 20:41 '2016-04-01-21-00-Wasted Fridays.mp3'

Now, I tried to escape the \' like that, but I get:

 $ mv \'2016-04-01-21-00-Wasted\ Fridays.mp3\' 2016-04-01-21-00-Wasted\ Fridays.mp3 
mv: cannot stat ''\''2016-04-01-21-00-Wasted Fridays.mp3'\''': No such file or directory

Now, it looks like it ignores the quotes. I tried without, look at this:

 $ mv 2016-04-01-21-00-Wasted\ Fridays.mp3 2016-04-01-21-00-Wasted\ Fridays.mp3
mv: '2016-04-01-21-00-Wasted Fridays.mp3' and '2016-04-01-21-00-Wasted Fridays.mp3' are the same file

Uh, how to deal with that? How to remove a single quote from a file name?

I'm on ArchLinux if this matters. Filesystem is ext4.

marked as duplicate by don_crissti, Jeff Schaller, soc1c, Community Apr 6 '16 at 10:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Is your 'ls' aliased to something? It looks like it may be adding quotes "for" you. Try /bin/ls to compare. – Jeff Schaller Apr 6 '16 at 9:52
  • That's probably it, don_crissti. 5chdn, you can confirm with something like ls | cat – Jeff Schaller Apr 6 '16 at 10:21
  • ls -N is the solution. Is does some weird stuff. not related to alias. and the file name is intact. – soc1c Apr 6 '16 at 10:47
  • 1
    ls no longer does what the user wants or expects, and instead of following the unix tradition has decided to do it's own thing. I'm annoyed too. – Wyatt8740 Apr 22 '16 at 23:43