I have a bunch of 'junk' files left over from a red-ball situation


Recommended Posts

Short story is this.  I had some serious hard drive problems, I seem to have most of that resolved now, but now I have a lot of files that have . in front of the file name and .asdfokex at the end of them.

 

for example movie .name.mkv.2lkxvels

 

I believe the . at the beginning means it's hidden

 

I suspect these are files that were in the process of being moved when bad things happen.

 

Regardless of how it happened, how do I find and eliminate all these files, which are spread all over my folders on several hard drives?

Link to comment

You can find them using find, similiar to:

 

find /mnt/user/ -name ".*" -print

 

In theory, you can use:

 

find /mnt/user/ -name ".*" -exec rm {} \;

 

I am always a bit worried about mass delete scripts, so i might just build a file of rm commands so I can verify what is happening.  From a shell:

 

 

find /mnt/user/ -name ".*" -print |

while read x

do

    echo "rm ${x}" >> mydeletefiles

done

 

Then your mydeletefiles will just be alot of rm (delete commands) you can verify and then run if you are happy with the list...

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.