Can't delete a file in the trash on OSX 10.11.6


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Can't delete a file in the trash on OSX 10.11.6
# 15  
Old 12-20-2016
DukeNuke2,

Again, no luck:

Code:
djCUDA:ee macuser$ find . -maxdepth 1 -type f -inum 3774747 -delete
find: -delete: unlink(./␀INITPicker 2.0): Invalid argument

I know essentially nothing about UNIX, but surely I'm not the first person to run into this problem of a NUL in the filename?

I appreciate members taking the time to post suggestions! regards, David
# 16  
Old 12-20-2016
Quote:
Originally Posted by djfilms
DukeNuke2,

Again, no luck:

Code:
djCUDA:ee macuser$ find . -maxdepth 1 -type f -inum 3774747 -delete
find: -delete: unlink(./␀INITPicker 2.0): Invalid argument

I know essentially nothing about UNIX, but surely I'm not the first person to run into this problem of a NUL in the filename?

I appreciate members taking the time to post suggestions! regards, David
The name of a file is a null-terminated string, so it is normally impossible to create a file with a name containing a null character. Please change directory to the directory containing the file you can't remove and then show us the output you get from the command:
Code:
ls *T* | od -bc

# 17  
Old 12-21-2016
Hi,

I'm hopefull that you've already tried the empty trash from the GUI and that that just failed to remove the file, what I would also suggest is that you try and rename the file within the GUI and then delete it.

I have seen something similar to this on my Macbook, but can't remember whether I deleted it from the CLI or the GUI.

As a last option, you could also check out the stuff here at the Apple Support page.

Regards

Gull04
# 18  
Old 12-21-2016
Another trick that I have used on Unix with great care is:

Code:
 
 # cd <directory of oddly named file>
 # rm -i *

which will offer you every file in the directory for a Y/N for deletion. You can then say 'N' for all but the file that you want rid of where you say 'Y'. However, it's not much good on a directory with thousands of files in it and you must double check you location and everything before you use it.

I've just checked the OSX man page repository on this forum and 'rm' in OSX does support then '-i' switch.
# 19  
Old 12-21-2016
I created a file with the same name as the OP and tried to delete it with every trick in the book. No luck! The problem is the "NUL" character at the begining which is a 3 byte character and nothing seems to work for that. I found a website which claims that this is a Mac OS 10.11.X only problem. Now I'm also stuck with that file... But in the next few days I will do a complete new install of 10.12.X and so I'm not concerned much, yet! Smilie

But I'm glad if someone is able to find a solution!
These 2 Users Gave Thanks to DukeNuke2 For This Post:
# 20  
Old 12-21-2016
Does OSX support specification of a character in the form ^000 to represent NUL?

---------- Post updated at 12:12 PM ---------- Previous update was at 12:03 PM ----------

@DN2......since you are going to rebuild the system anyway, does OSX support 'clri' command? If so, what happens if you nuke the inode completely using that?

Yes, know that in such circumstances the blocks of the cleared file will show up as 'missing' on a fsck.

Repeat, I'm not an OSX user so I'm just talking generic Unix/Linux here but I've nuked many an inode (with success) to clear a file and then run fsck afterwards to clean up.

Everyone except DN2 please ignore this post. It's dangerous!
# 21  
Old 12-21-2016
The clri command is not part of OSX. On which system did you use it?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

XFCE Desktop - trash, cannot execute file, command prompt here missing.

Hi there, I am using the xfce4 is already the newest version (4.12.5). thunar is already the newest version (1.8.4-1). The distribution is Linux kali 4.19.0-kali1-amd64 #1 SMP Debian 4.19.13-1kali1 (2019-01-03) x86_64 GNU/Linux However, the problem is: When I when I click on any program to... (2 Replies)
Discussion started by: alvinoo
2 Replies

2. Shell Programming and Scripting

File Locking with fcntl on Darwin Mac OSX

Hello I have a Perl script that works on non-darwin Mac OS X environments and I think I have narrowed down the issue to a file locking problem. In other linux environments, the flock struct is defined differently. I have adjusted this via the reference for Mac OS X fcntl(2) man page. The... (4 Replies)
Discussion started by: flagman5
4 Replies

3. Solaris

trash can in solaris

one quick question please.. is Solaris have a RECYLE BIN,or TRASH to retrive deleted files accidently ? (0 Replies)
Discussion started by: Sojourner
0 Replies

4. Homework & Coursework Questions

Delete restore and empty trash

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: A set of Linux shell scripts is required to allow users to ‘remove' files without them really disappearing... (1 Reply)
Discussion started by: mr100perecent
1 Replies

5. UNIX for Dummies Questions & Answers

Trash

Hello, I deleted a file accidentally using rm-f inside a folder. Is there any option/command to retrive the file or is it possible to recover from trash? or once the file is deleted, it is gone completely?? (2 Replies)
Discussion started by: sydney2008
2 Replies

6. Linux

Emptying Trash

Hi all i hope someone can help me, in gnome if you right click on trash, you get another menu appear 'Empty Trash' what i want to do is be able to edit this command so that it secure deletes the trash, where is that command? so i can edit it. thanks in advance for any help, Dave (shred -z -u ) (0 Replies)
Discussion started by: dave123
0 Replies

7. Filesystems, Disks and Memory

unix executable file problem on MAC OSX ??? please help

I've got this problem. My computers and external hard drives are converting many of my files to a Unix Executable File which has a grey terminal looking icon. I don't understand what is causing this to happen. It is happening to a large number of my image file of different formats and also... (1 Reply)
Discussion started by: chadb
1 Replies

8. Solaris

Script for automatic deletion of trash file of mail server

Hi, I have a mail server with limited space and operating system is sun solaris 8 (sparc). I do not have provisions to increase the space for home directory. So i have to delete files from /home/username/mail/trash which are more than 10 days old automatically. So my script should be like... (1 Reply)
Discussion started by: crown2100bd
1 Replies

9. UNIX for Dummies Questions & Answers

file permisions 2000 to OSX

Could anyone tell me how or point me in the right direction on how to save files from a 2000box to a OSX server with the correct file permissions. File goes over and the only person that has r/w permissions is the owner everyone else is read only. HELP!!! (2 Replies)
Discussion started by: mom
2 Replies
Login or Register to Ask a Question