Find and delete files with common name in different directories

I have hundreds of invisible files in many different directories on my 10.4.11 server with .fstemp at the beginning of their name.
They are taking up space and I would like to delete them.
I can find them using
find . -type f -name .fstemp
But I can't work out how to use the rm command with a wildcard to delete them - I don't want to have to visit many different directories and run rm.
Do I need to pipe the results from the find to rm ?
For extra credit (you can probably tell I am out of my comfort zone here)... the files are all locked. I believe they will need to have
chflags nouchg /Directory/filename
applied to unlock them before they can be deleted. Can the terminal pipe find|chflgs|delete?
Thanks,
b.

Well, if they weren't locked you could just 'delete' them in the find command. Otherwise …
Open the Terminal (from /Applications/Utilities) and copy and paste the following into the Terminal window, one line at a time, with a return after each line:
sudo -s
find / -type f -name ".fstemp*" -exec echo 'chflags nouchg "{}" && rm -f "{}"' ; | sh
I have tested this, but obviously with some substitutions. You only need the double quotes around the curly brackets, "{}", if your filenames contain a space.
To be on the safe side, you should check this out without the final "| sh". Then you will see the commands that would be executed with the full version.
Finally type exit to get out of the root shell.

Similar Messages

  • Cant find and delete files

    Oh boy where do I start. I don't want to sound like one of these windows switchers who complains that things on a Mac seem complicated but things on my new Mac mini sure do seem so complicated.
    I've had my mini Server (2 x 1TB drives) only a little while, I'm running it alongside my Windows 7 PC which it is to replace eventually. I'm just familiarizing myself with it at present.
    The only thing I've done was to import 300Gb worth of photos/videos to the 'second' drive to have a play with iphoto, big mistake.  Iphoto constantly hangs and crashes, it cant seem to handle this amount of files so I deleted the pics/vids.  I've put nothing else on the Mac. 
    I then notice that the 'first' drive (the server drive) shows 320Gb worth of photos/videos on it?  They are the photos/vids I deleted from the second drive. How, I didn't put them there?  iphoto shows all pics/vids still there.
    I've spent hours trying to locate them, some seem to be on a dated folder: server-users-name-pictures-iphoto library-master (folder)- 2013-10-13-20131013-235601. Is this from me using Time Machine for a while? TM worked ok but the backups seemed to be getting very big so I switched it off and deleted all backups. 
    I only found the location above by taking a screenshot of a spotlight search, if I navigate in finder it only shows stuff up to 'iphoto library' nothing after. The 'iphoto library' is 75Gb but there are 300Gb in total. I've have finder set to show hidden folder.  In iphoto I put the files into trash and tried to delete them, it deleted some of them but it very easily crashes. There are some files iphoto won't let me put into trash saying it doesn't support those files and to use Aperture. (I don't have nor want Aperture).
    This is where I am now: some of the files seem to be in the dated folder above which I can't find (Finder doesn't seem very good at finding stuff). I can't delete the files from iphoto as it crashes very quick, in fact iphoto can now barely start up without crashing.  I don't know where the other 200+Gb files are but they are on the first drive. The object is simply to delete all the pics and vids on the first drive.
    No doubt one of you guys are going to show me some Mac magic to solve this problem in a flash making me look an idiot, well I'm cool with that just tell me what it is.
    Thanks in advance.

    iPhoto is, and always has been, a very cumbersome app.  That really doesn't have anything to do with Finder though. I used iPhoto way way back around version 4 or 5, before I took up "Photoshopping". I've had it on every Mac I've owned, but I don't think I've opened it since 2006. The iPhoto library takes up MASSIVE amounts of space and the bigger it gets, the harder it is to manage. Adobe Bridge does a much better job, and so does Photoshop.
    Once you get used to the ins and outs of Finder, you'll see that it's more intuitive than Explorer. Things it does that Windows may or may not ever do, like showing a complete file path from the top of window with just a right click on the title.
    And that's just a start.

  • Can't import RAW and psd file with same name different extension

    Trying to import a folder of images from desktop that I have been working with in Bridge CS3.
    LR won't import a RAW file that has a PSD file by the same name. Tried renaming the PSD and deleting the one with the same name, but says it is still there and won't import the RAW file - What is the correct workaround on this? Why can't it import same name files with different extensions?

    A forum search for 'RAW + JPEG' will give you more posts on this than you care to read. This will change. For now, import the RAW and PSD's from separate folders and then move them together for within LR.
    LR is seeing the RAW as a sidecar to the PSD. It is an unforseen effect of the RAW + JPEG thing where they decided to not import the JPEG, seeing it as basically a preview image for the RAW.
    LOL
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core running 10.4.9 & Win XP, Pentax *ist D
    http://donricklin.blogspot.com/

  • Finding and deleting files

    Hi,
    As an Automator newbie, here is what I did to delete all the .DS_Store files under a certain directory:
    1) Find Finder Item:name contains .DS_Store
    2) Move to trash
    I was hoping this will find all the .DS_Store files under a directory and its sub directories and delete them, but turn out nothing was achieved, any idea what I did wrong here? thanks,

    There are free utilities that will remove those files. Look for them at VersionTracker or MacUpdate.
    You are aware that although you may delete them they will simply be re-created by the operating system?

  • Windows 2012 R2 - ReFS - Can not delete file with invaild name

    I have a file, its name is ÿÿÿÿ.out
    its in a network share.  its causing the backups to fail on it because its invalid.
    in the past on NTFS i would just run chkdsk and then it would fix something like this.  but can't do that on this.
    Chkdsk just says "Refs doesn't need to be checked"
    tried from the GUI also, same thing "volume doesn't need checking"
    also i tried the magical "maintenance" on server 2012 properties.   nothing
    i've tried all sorts of command prompt tricks...  Also i've created file names in the same folder like "asdfalksdjfhsalkfsafddsaf.txt" and deleted them (just in cause the name length might be the issue because its in a long folder tree)
    Its a file name, called ÿÿÿÿ.out   
    Any ideas ?

    Hi,
    I just discussed this issue in this thread:
    http://social.technet.microsoft.com/Forums/en-US/4a90066d-aa2d-4f57-976e-ec1b65a4bcec/weird-behavior-with-refs?forum=winserverfiles
    It seems that ÿ is not supported as a file name in Refs file system.
    If you have any feedback on our support, please send to [email protected]

  • How to open files with "return" key and delete files with "delete" key?

    Hi friends,
    It's been over a week since I got my iMac and I'm loving it. However, while I'm adapting alright to 'mac' key shortcuts (e.g. using the COMMAND-S for save as opposed to CONTROL-S used in PC).
    However, there are 2 things that are annoying me greatly right now.
    1. I like selecting files with keys as opposed to using the mouse. I make animations and prefer keyboard shortcuts. However, when I hit "return", instead of opening the file it goes into file-renaming mode. How do I change this? Likewise, I would like to delete files by hitting the delete key. This does not work - how do I change this?
    2. When I click SHIFT key sometimes, it gets 'stuck' - which is annoying because I start typing CAPITALS when I wasn't aware I've activated the CAP-LOCK key. How do I get rid of this? Like, I don't want to hit SHIFT for instance, and have that up arrow thing 'stuck' there.
    Your help would be greatly appreciated! Thanks!
    iMac G5   Mac OS X (10.4.9)  

    Hi
    Thanks for the star.
    If you went into Mac Help & searched, 2 results come up:
    Full keyboard access shortcuts for interacting with items (for selecting & activating controls).
    Full keyboard navigation keyboard shortcuts (for navigating Desktop, Windows, Menu bar etc)
    From the lists, select the link that closely describes your situation.
    I have to say that I can't reproduce your problem, does this happen just in applications or in everything? I don't know if it's to do with this but pressing Shift 5 times turns on Sticky Keys & Option(Alt) 5 times to turn on Mouse Keys (System Preferences>Universal Access>Keyboard).
    After typing "Sticky Keys" into Mac Help, I found this:
    "Pressing a group of modifier keys as a sequence
    To perform many tasks on your computer, you need to press one or more modifier keys (Shift, Command, Option, and Control) at the same time as another key. For example, pressing Shift-Command-Q in the Finder opens the Logout dialog.
    If you have difficulty pressing several keys at once, you can make it easier to press a set of keys by turning on Sticky Keys in the Universal Access preferences pane. With Sticky Keys turned on, you can press a set of modifier keys as a sequence. As you press each key, the symbol for the modifier key appears on the screen.
    Choose Apple menu > System Preferences and click Universal Access. Then click Keyboard.
    Select the On button next to Sticky Keys.
    To hear a sound whenever the computer registers that you have pressed a modifier key, select "Beep when a modifier key is set."
    To see an icon indicating which modifier keys you have pressed, select "Display pressed keys on screen."
    You can also use Slow Keys to adjust the amount of time between when you press a key and when it is activated."
    Any of this close to your problem?
    Steve
    Edit: I'm right, it's Sticky Keys:
    http://www.macusenet.com/190284-post2.html

  • How to find and delete files

    hi,
      I am facing a strange issue. I am having sp 2013, sql , vs 2012,sp d 2013,  caml designer  etc. for the first few weeks , the SP and VS debuggingetc etc everything worked fine. now suddenly i am seeing that my C drive
    is consumed some 235 GB+ space!!! Its strange, as I am not using any extra s/ws for consuming this much of space.
    Can anyone help, where / how should i delete the unwanted space.
    in my sql server 2012 DATA folder, i am  able to see the below files with huge size.

    Sometimes the drive get full because Volume shadow service.
    You can use tool like Tree view.
    To see the space has occupied by what and you deleted the unwanted data.
    Thanks and Regards Rahul Dagar

  • Compare folders and output files with same name?

    I'm trying to compare two folders and print only the excel files in folder B that have the same names as the pages files in folder A. I've tried using the completedigitalphotography "compare folders" action, but it will only output files that are of the same type, not just the same name.
    Any ideas?
    iBook G4   Mac OS X (10.4.4)  

    I tested this out on my own seat and I think it should work for you. I wrote it as a function, all you have to do is pass the root folders you want to search and the file your looking for. The function will then search that directory and all sub directories
    for that file name. you will also have to provide it a file to append to, if the file dosen't exists the function will create it. If you run into an issues let me know and the links Mike
    Laughlin posted are a great resource.
    Function Search-Files{
    Param([String[]]$Locations, $SearchFor, $AppendTo)
    Begin
    If(-Not (Test-Path $AppendTo)){New-Item $AppendTo -ItemType File -Force}
    Process
    ForEach($Location in $Locations)
    $Files = Get-ChildItem -Path $Location -Filter $SearchFor -Recurse
    ForEach($File in $Files)
    Get-Content -Path $FIles.FullName | Out-File $AppendTo -Append
    End{}
    Search-Files -Locations "\\Server1\c$\Temp", "\\Server1\c$\Test1" -SearchFor "Install.cmd" -AppendTo "C:\Temp\Search.log"

  • Files with same name in different packages

    I have a file with the same name defined in two different packages.
    When I generate the javadoc, I get an error saying that
    Class com.eg.toolkit.Email already defined in com.eg.common.Email.java
    Does javadoc expect all files to be of different names acroos packages?
    Thanks
    Chintu

    You can use the same class name in different packages.
    The Java API does that (java.awt.List, java.util.List).
    This is odd. What version of javadoc are you using,
    and what command are you passing in, with what classpath setting?
    -Doug Kramer
    javadoc team

  • Importing files with same name but different extensions

    Hope I will be clear enough.
    Lets say that instead of sending a file from Lightroom to an external editor, I open it directly in Photoshop.
    When I'm done, I save the edited photo using the same name but in a different file format : IMG_1333.cr2 > IMG_1333.psd or IMG_1333.tif, and selecting the same folder location.
    Then, I come back into Lightroom and synchronise the folder.
    Why is the knew version of the picture not showing up beside the original file, despite the different extension ?
    I notice that the different extensions ( .psd or .tif ) are recorded in the sidecar files field in the Metadata panel.
    Of course, everything works fine if the file name is modified ( or just by selecting the "copy" option in Photoshop's "save as" dialog box ). Lightroom synchronise dialog shows the new photo to import.
    So, why is Lightroom not making a difference between files with the same name but different format extensions ?
    Thanks for any hint :-)
    Gilles.

    Gilles-
    I think your problem is likely that you have the option to stack the copy with the original turned on. First, right-click on one of these photos and go to the stacking menu. If Unstack is not grayed out then you have a stack -- select Unstack to reveal all copies.
    To change the automatic stacking of edited copies from Photoshop, when you next choose to edit a file, in the bottom left corner of the dialog is the check box for unstacking. Clear it, and that choice should "stick" until you change it again.
    Hope this helps!
    Tony

  • Batch processing: save processed file with same name to different location without moving the original

    Hi, I would like to denoise Voice Over files with help of Auditions Batch Process. However, I have to save the files with the same name as the original, so that I can simply relink them in Premiere. Since I do want to keep the originals, I would like to save the processed files to a different location.
    Unfortunately, Batch Processor adds " Copy" to the processed files and moves the originals along with the processed files to the new folder (causing Premiere to loose the original files).
    Can I achieve my goal with Batch Processor, and how would I have to configure it?
    Kind regards,
    Andreas

    Which version of Audition are you using? The latest ones allow you to specify where the batched files are saved and also if any Prefix or Postfix are added to the file name. These are all under Export Settings in the Batch Process pane. However you must have the Export box ticked to give you access to the settings.

  • How to check-in multiple files with same name having different revision num

    Hi
    Can anyone please tell me, how to check-in multiple files with the same name with different revision number using RIDC API.
    For eg:
    First I will check-in a file(TestFile.txt) into a content server with revision number 1 using RIDC API in ADF application. Then after some time, will modify the same file(TestFile.txt) and check-in again. I tried to check-in same file multiple times, however first time its checking-in correctly into server showing revision as 1, while checking-in same file again, its not giving any errror message, and also its not reflecting in server. Only one file(TestFile.txt) is reflecting in server.
    How to implement this functinality using RIDC API? Any suggestions would be helpful.
    Regards
    Raj
    Edited by: 887680 on Mar 6, 2013 10:48 AM

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

  • How do you find a deleted file with doing a recovery? Windows 8.1

    I have a new 8.1 Windows laptop and inadvertantly deleted a document, how can I retrieve it?

    Have you checked in the Recycle Bin?
    You can also try File History:
    http://windows.microsoft.com/en-us/windows-8/how-use-file-history
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • How to mass-reindex files with same name but different file extensions

    (reposting cos I'm confused about if I posted in the proper place before. Please delete if it is a repost.)
    So I'm on a remote workflow. I pick all the raw data and convert it in two quality standards, one on 'high' with full specifications and one on 'low' so I can send 2gb instead of 80gb of files through the internet for me to work remotely on, and to speed up the overall work rhythm because files are lighter. All I need to do is to work at my home with the low quality files, send it back to the client's computer after finished, re-index all files in their high resolution twins and we are good to go to finish the product with highest quality possible. But both high and low quality files need to be the same extension, that I picked .mp4 for it is the standard for pretty much anything.
    The point is, if I want to go full mobile, I only have an old HP Pavillion notebook and I really need to work with a video codec that goes very easy on it. I can only think about some 16:9 DV format. But the point is, this format generates a different file extension than my .mp4 standard, and Premiere, to my knowledge, really can't reindex files using only the file name while ignoring the file extension. It really should. And I really need to know how.
    We also need to consider Premiere versions that allow themselves to be installed at x32 processors. My desktop is x64 and I really have no problem to work on these standards, the problem is, in my notebook I really can't.
    So, halp?

    i want to say it was added in cs7, which requires subscription, so in that case might as well be using latest version 8.  if you had to use an older version like cs5, you could still use h264 or low bitrate dnxhd/prores codecs inside a quicktime .mov file. that would allow you to have same file ext on both versions of files.

  • Change selected file to a file with same name but different extension.

    So I'm getting better at using Automator to create useful Services but still a bit of a newbie with doing powerful things with AppleScript... and I think this task requires some applescripting. Here's what I want to do:
    1. Based on a selected text file I want to run a pre-existing script that converts this file into an HTML file. This new file has the same name as the text file but has the .html extension rather than the .txt extension. (This step is easy enough and it works just fine already.)
    2. BUT NOW, I want to take that resulting HTML file and run another pre-existing script that converts the HTML file into an RTF file. The problem is that I basically want to change the selection from selectedfile.TXT to selectedfile.HTML so that I can proceed to this next step...
    3. AND THEN, I want to launch an app with this resulting RTF file. Again, I need to change the selection to selectedfile.RTF.
    Right now this requires me to run three different services, and changing the selected file between each step... But I'm sure there's an easy applescript way (or other way) to do this using just one service -- probably involves some filename parsing and some magic to change the selection??? -- or something like that...
    Could anyone point me in the right direction???
    Thank you thank you thank you!
    ~zyyyy

    You can chain your scripts together - depending on the complexity of your pre-existing scripts, you could do this with either AppleScript or Automator. The workflow would just take the selected text file (from step 1), convert to both HTML (2) and RTF (3), then launch your application with the resulting RTF - no need to change any selection.
    By the way, this is the Tiger Automator forum - Snow Leopard's Automator is quite a bit different, so you will probably have better luck posting in the Snow Leopard forum.

Maybe you are looking for