can't delete files from desktop with High Sierra

I have some file folders and a PDF I saved to my desktop that I cannot delete. The files will act like they are going into the trash when I drag them, but then move right back on the desktop. The PDF keeps telling me I do not have permissions to access all the items in it. I have tried to reset permissions to no avail. Any suggestions?

Mac mini, iOS 10.3.3, On IOS 10.13.4

Posted on May 3, 2018 8:38 AM

Reply
Question marked as Top-ranking reply

Posted on May 4, 2018 1:45 PM

Sorry, I didn't edit all the way through in my post. So back in Teminal:

$ cd ~/Desktop

$ rm -f ./avalon_ebrochure.pdf


For Folder:

# You must escape file/folder names containing white-space or other reserved characters in the Terminal.

$ file ./"Verizon Receipts"

$ rm -rf ./"Verizon Receipts"


Did either, or both of these return without any message in the Terminal (which would mean they were removed)?

29 replies

May 4, 2018 2:25 PM in response to MrHoffman

Here's the results, I have not tried the sudo commands


Roberts-Mac-mini:~ bob$ id

uid=502(bob) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81( _appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),250(_ analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),39 9(com.apple.access_ssh)

Roberts-Mac-mini:~ bob$ cd ~/Desktop

Roberts-Mac-mini:Desktop bob$ ls -ale@ ./avalon_ebrochure.pdf

-rw-r--r--@ 1 bob staff 1696256 Jun 3 2016 ./avalon_ebrochure.pdf

com.apple.lastuseddate#PS 16

com.apple.quarantine 22

Roberts-Mac-mini:Desktop bob$ ls -aled@ .Verizon\Receipts

ls: .VerizonReceipts: No such file or directory

Roberts-Mac-mini:Desktop bob$ ls -aled@ ./Verizon\Receipts

ls: ./VerizonReceipts: No such file or directory

Roberts-Mac-mini:Desktop bob$ ls -aled@ ~Desktop

ls: ~Desktop: No such file or directory

Roberts-Mac-mini:Desktop bob$ ls -aled@ ~/.Trash

drwx------ 5 bob staff 170 May 4 11:27 /Users/bob/.Trash

Roberts-Mac-mini:Desktop bob$

May 5, 2018 8:25 PM in response to Title Man

Trying to do the sudo rm delete and the terminal will not let me enter a password, see below


Roberts-Mac-mini:~ bob$ sudo rm -if ./avalon_ebrochure.pdf

Password:

Sorry, try again.

Password:


There is like a key there in the password line, assume that is where it needs to be unlocked, but not sure what to do

Also downloaded Avast Security and ran a scan and detected 45 infections. Deleted those

May 6, 2018 8:52 AM in response to Title Man

Follow Step 6 here:

What to do before you sell or give away your Mac - Apple Support

Title Man wrote:


Would I be bringing back the problems if once new operating system installed I use my backup to reinstall data?

Yes, quite possible. I would make a clone and then just replace your own files via drag and drop.

You can use a cloning software like SuperDuper! or CarbonCopy Cloner.


The advantage of the clone is that you can boot from it and use the system. So, if your hard drive fails you can just boot from the backup and keep on working until you have the time to repair or replace the internal drive. You can also drag and drop files with the clone because it is the identical file structure on your primary drive.


The advantage of TM is that it creates recursive backups, so you can restore a file or the entire drive from a certain point in time.


But wait a bit and see if others who have responded chime in.

May 4, 2018 11:59 AM in response to léonie

I recommend this modification to your terminal command, where the op only types the blue commands in Terminal:


$ cd ~/Desktop

# comment: test if it is a PDF or folder

$ file ./avalon_ebrochure.pdf or ./foldername

# comment: if PDF document

$ rm -if ./foobar.pdf

# comment: if directory

$ rm -irf ./foobar


This will prevent any run-away deletions.

May 4, 2018 1:50 PM in response to Title Man

Assuming those rm commands didn't work... The following shows your own ownership and access, then changes the default directory to your desktop, then displays the full attributes for one PDF file and three directories.

id

cd ~/Desktop

ls -ale@ ./avalon_ebrochure.pdf

ls -aled@ ./Verison\ Receipts

ls -aled@ ~/Desktop

ls -aled@ ~/.Trash


Spaces need to be in double-quoted quoted strings or backslash-escaped within filenames, and I'm assuming that the spelling of "Verison" in that "Verison Receipts" filename was not a typo; that it wasn't intended to be the "Version Receipts" directory. The commands ls -aled@ ./"Verison Receipts" and ls -aled@ "/Users/{yourshortnamehere}/Desktop/Verison Receipts" should also work.


The next step past the attempted rm commands is probably to invoke root access and attempt to delete the files and directories from there; from the root user. Make sure you have complete backups of all of your data before proceeding here, because subtle mistakes in an rm or particularly sudo rm command can be catastrophic. You'll have to enter your admin password for the sudo command, and you might get a one-time warning about the use of sudo. And I'd suggest just posting the output of the above before proceeding with the sudo rm commands, in any case. The sudo is a pretty big and sometimes hazardous hammer, in other words.

sudo rm -if ./avalon_ebrochure.pdf

sudo rm -irf ./Verison\ Receipts


It's possible that an immutable attribute is set, or that the file and directory ownership of the files is unexpected.

May 4, 2018 2:17 PM in response to VikingOSX

Here's the results:


Roberts-Mac-mini:~ bob$ cd ~/Desktop

Roberts-Mac-mini:Desktop bob$ rm -f ./avalon_ebrochure.pdf

rm: ./avalon_ebrochure.pdf: Operation not permitted

Roberts-Mac-mini:Desktop bob$ file ./"Verizon Receipts"

./Verizon Receipts: directory

Roberts-Mac-mini:Desktop bob$ rm -rf ./"Verizon Receipts"

rm: ./Verizon Receipts: Operation not permitted

Roberts-Mac-mini:Desktop bob$

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

can't delete files from desktop with High Sierra

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