You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Unable to delete a file - Error code -50

Hello everyone!


I am unable to delete (move or modify) a couple of files in my download folder. If I try, I get the following error: "The operation can’t be completed because an unexpected error occurred (error code -50)".


The files do not appear in the terminal when listing the files on the 'Downloads' folder, they can't be moved, or can't be forced removed using the terminal. I am stuck, and I don't know what to do.


These two files were sent through WhatsApp (if that is helpful).


Very simple but frustrating issue. Any help would be appreciated.


D.F.



Posted on Jun 30, 2022 12:56 AM

Reply
13 replies

Jun 30, 2022 4:40 AM in response to PRP_53

Hi,


We are talking about the files (~$[name].docx) that are no longer relevant to this question - but I will answer this anyway: they were hidden files as they are temporary files generated by MS Word for recovery (hopefully this answers 'how?'). I didn't make the files hidden nor I generated the files. This has been answered in the following thread ('why?'): What does a ~$ in front of a file name in… - Apple Community.


Going back to the main question: any other suggestions on how to delete the files:

  • Research Proposal Edited + Ref.pages (1)
  • Research Proposal Edited + Ref


Just as a reminder, when trying to delete them I get the following error: "The operation can’t be completed because an unexpected error occurred (error code -50)".

Jun 30, 2022 7:08 AM in response to PRP_53

Solved!


Using 'rm' + 'filename' in the terminal.

Surprisingly that did the job.


I was forced to add the filename manually, as listing files in the terminal didn't bring the filename and therefore I was unable to navigate to the file.


No sudo.

No SIP.

No Disk Utility.

No Safe Mode.


Just using the 'rm' command in the terminal.


Simply from the terminal -> navigating into the 'Downloads' folder (cd Downloads) and then:

rm '.Research\ Proposal\ Edited\ +\ Ref.pages.icloud'
rm '.Research Proposal Edited + Ref.pages (1).icloud'


*Filename added manually!


PS: the following commands didn't show up any file (which force me to write the filename manually):

cd Downloads/
ls -l

Jun 30, 2022 3:58 AM in response to PRP_53

Yes, exactly. That was meant to be one of my points: that the filenames of the items I am trying to delete do not appear when listing the files in the terminal. Files to be deleted:

  • Research Proposal Edited + Ref.pages (1)
  • Research Proposal Edited + Ref


The 3 files - that you mentioned (with .docx suffix) - listed in the terminal are meant to be hidden temporally files from Microsoft Word documents - and the reason why they don't appear in Finder. I did try now to delete those hidden files too - but I also get the following error from the terminal window: "rm: ~ Energy - Data Scientist JD.docx: No such file or directory".


So yes, oddly as it seems - the files that does appear in Finder they don't appear in the terminal. On the other hand, the files that do appear in the terminal, they don't appear in Finder (while this may be expected as been temporarily files from MS Word - I have been unable to remove them).


If it helps debugging this error - if I try to change the name of one those files to 'remame', I also get the following error.





Jun 30, 2022 3:32 AM in response to Daniel-FD

The representation in the Terminal command used to pointing to a " .docx " which is associated with a MS Word Document.


The representation in the the Second image of yours is showing an Apple " Pages " document.


The names in First image is " Data Scientist JD.docx "


The names in Second image are " Research Pro…al Edited + Ref " and " Research Pro…+ Ref.pages (1) "


Jun 30, 2022 4:21 AM in response to PRP_53

Hi P. Phillips,


Thanks for your help with this - I do appreciate it.


I don't understand your question fully, apologies. None of those files were in the 'Trash' folder - but on the 'Downloads' folder. *Let's forget about the .docx files (that were hidden files - and therefore the reason why they didn't show up in Finder - and only appeared in the terminal) - as I think they add confusion to my question.


If we also forget about the terminal: the problem is still simple: that there is two files in Finder in the 'Downloads' folder that can't be deleted with an error code (-50). *I though the terminal was useful to show that these files do appear in 'Finder' but do not appear in the terminal - which is extremely odd in my opinion.


Your solution with 'Safe Mode' didn't help in this situation.

Unable to delete a file - Error code -50

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.