Using Terminal to Find Locked Files

Hello all,
I am a photographer and often use the locking feature on my camera to lock certain images, ones that are good shots.  With Windows, I was able to sort by whether a file was locked or not.  However I am finding that Mavericks does not have this feature.  Therefore I have resorted to using terminal to find locked files.  However I was wondering if I could get assistance in creating a script/command that would take the results of the files I found locked and either copy or move them into a subfolder.
IE: I have an event folder called BRB-Team1VsTeam2.  I use the command "find . -flags uchg" to find the locked files.  What I need to do now is get the returned result and either copy or move into a subfolder called "locked".
I tried "find . -flags uchg && cp /locked" but I know the logic isn't quite there but I haven't played with terminal too much to know what I am doing.
So anyone have a solution to this?  Or know of an application to at least let me search/filter/sort by the file status (IE: Locked vs unlocked)?

Here is the basic idea, adjust as necessary. The -d option limits the depth into the folder you are searching. You don't need it; I just added if you want to limit the depth into subfolders.
find /search/path -d 1 -flags uchg -exec cp {} /destination/path \;
You could roll this up in an Automator workflow, Service, or Folder Action if you want:
By checking the "Show this action when the workflow runs" you can choose the destination folder at run time. If always the same, leave it unchecked.
A Folder Action would work on the items added to a particular folder. The find command would have to be modified.
A Service could be used to pick the source folder, or to add a shortcut command.

Similar Messages

  • How to find locked files and unlocked them???

    Having trouble for snxing itunes i need to find locked files but i dont know how and unlocked them so that i can sync again..

    When i connect my ipod into my computer "unknown error occured(-54)" is keep appearing thats why i cant see my library in my ipod.. And i think locked items caused this.. I open once another program that for browsing files to for iphones and ipods and after that the unknown error keep appearing and some of my musics are in grey i cant even delete it

  • How to use Terminal to Find or Locate files without extensions?

    I'm conversant with the cli, but not a power-user.  I've discovered a fairly large number of audio files, across dozens of sometimes nested folders, that (somehow) lost their '.aif' extension and now appear as Unix Executable Files.  Upon appending said files with the proper extension, they are perfectly normal audio aif's.
    My Problem: using the Terminal, how can I search a directory tree to find those files *without* an extension, discriminating between files and folders, and then append the correct extension to only the files?
    I've tried a number of queries, mostly built around the idea of using 'filename.*', but for some reason searching for an extension omission (as opposed to a specified string) isn't so simple. 
    The following: ls -al *.
    Brings up 'No such file or directory'
    And the following ls -al .*
    Brings up files AND directories
    I need o discriminate between files and directories, finds all files without extensions, and rename them with the appropriate extension.
    Can anyone help?
    Best, Tom

    The following will find files without a file extension in the current working directory and any sub-directories->
    find . -type f ! -name "*.*"
    If you are confident that the files found are the appropriate audio file (in this case aif) then you could->
    find . -type f ! -name "*.*" -exec mv {} {}.aif \;

  • Finding locked files

    I would like to look through my drive for locked files. I cannot find a way to search for them either with the Finder or with a terminal application.
    Does someone know how I might do this?
    Thank you

    Use a command such as:
    find ~ -flags uchg
    to search your home folder. Replace the ~ with a / to search everywhere in the drive you have access to. The schg flag may also be set on a locked file.
    (50693)

  • Using Terminal to copy all files (hidden and not hidden) and folders from one place to another

    How -using Terminal- can I copy all files (hidden and not hidden) and folders (and their contents) from one place to another

    ditto
    DITTO(1)                  BSD General Commands Manual                 DITTO(1)
    NAME
         ditto -- copy directory hierarchies, create and extract archives
    SYNOPSIS
         ditto [-v] [-V] [-X] [<options>] src ... dst_directory
         ditto [-v] [-V] [<options>] src_file dst_file
         ditto -c [-z | -j | -k] [-v] [-V] [-X] [<options>] src dst_archive
         ditto -x [-z | -j | -k] [-v] [-V] [<options>] src_archive ...
               dst_directory
         ditto -h | --help
    DESCRIPTION
         In its first form, ditto copies one or more source files or directories
         to a destination directory.  If the destination directory does not exist
         it will be created before the first source is copied.  If the destination
         directory already exists then the source directories are merged with the
         previous contents of the destination.

  • Use Spotlight to find a file

    I can use Spotlight to find and open a file or document, but sometimes I want to see where on my hard drive a particular  file/document is.  When I was using Snow Leopard the path would be shown at the bottom of the window.  How do I find the path using Spotlight in Mavericks?

    Highlight the result in Spotlight, a preview appears, hold the command key down and the name will appear, continue to hold it and the path will appear.

  • How Do I use TM to find a file on my computers Idisk from today's backup?

    Where do I find the file that is on my Idisk's Time Machine Backup that was on my laptop this morning when TM backed up????? My Idisk had a problem this morning and when I sought help, they had me hit the stop and restart the syncing. The problem is that even though there was a file on my Idisk on my computer from last night, the Idisk syncing reset every file from the mobileme cloud to my laptop and the file on my mobileme cloud was from 2 days ago. Not the updated one from last night. I teach and my attendance is all taken and stored on the Idisk (and synced) from all my classes. Wed & Thursday attendances were on my laptop correctly. (I know because I checked BEFORE they told me to restart the sync button on preferences. My laptop did its normal BU this morning so I am trying to find the excel attendance file on the backup. Can anyone help????????
    I don't know why that happened but it did!!!
    Thanks for any help you can provide.
    Skip

    Dear Thomas,
    I entered TM and found the sparsebundle under the Filesync library. However, it appears NOT to be recoverable and I tried double clicking on it but it doesnt do anything other than show a summary of what it is.
    By the way, I really do appreciate your comments and agree completely. Something strange happened with my syncing of Idisk (which is set to "automatic"). It has been working fine for years. But for some reason, it stopped two days ago and did not let me know. When I tried to put something manually on it (through drag/drop), it never showed up on the Idisk on the cloud which made me notice and check it out by going to Mobileme through the browser. I then went to the tech service for Idisk and they explained that something probably got corrupted so just hit STOP syncing and then hit Automatic again. Which is what I did. Then everything from the cloud went to my Idisk on my computer and for some reason, the latest version of my excel spread sheet for attendance showed two days ago, not last night. so I lost wed/thursday classes. I KNOW it was on my Laptop which is backed up to TM every morning.. Thats why I believe that the latest file IS on my TM backup for this morning. But I can't get to it. Any other help would be appreciated.
    Skip

  • How can I find locked files

    Is there a way to search for locked files on a Mac?

    Try the Hidden Files Widget for Dashboard. So you have on Dashboard a button to show or hide your files.
    Tested by me on Snow Leopard and Lion.
    http://www.apple.com/downloads/dashboard/developer/hiddenfiles.html

  • How to recover trash emptied docx file using terminal!! please help, many recovery software doesnt work!

    i accidentally deleted a .docx file today and emptied it in the trash!! i tried to use softwares like iskysoft,stellar,wondershare, but none can find the required file! I also tried to use terminal to recover my file by typing --> Tserings-MacBook-Pro:~ tseringdorjee$ mv .Trash/OS copy .  but ended with
    mv: rename .Trash/OS to ./OS: No such file or directory
    mv: rename copy to ./copy: No such file or directory
    where OS copy is the name of my .docx file! i also tried to put .docx after the file name, but it doesn't work too!
    so, please help!!!

    If you placed the file in the trash and emptied the trash and recovery software is unable to get the file back, I'm afraid it is gone.
    You will have to resotre from backups if you any,  or else try sending the drive to a commercial data recovery outfit. But it will be very expensive and the likely hood of a better outcome is not high.
    regards

  • Search for Locked Files

    Is there anyway to search a folder for only locked files?
    Thanks
    Ro

    Unfortunately the option to search for files that are read only, which one would think meant locked files, simply doesn't work. The only method to find locked files I know of uses the Terminal. See this archived discussion:
    http://discussions.apple.com/thread.jspa?messageID=1167705&#1167705
    Hope the explanation is clear enough!
    Francine
    Francine
    Schwieder

  • IBook need a diet. How to find biggest files/folders?

    Hi -- this may seem like a silly question, but is there a way to search for the largest files/folders on my iBook (latest version of Tiger)? I'd like to find the offending bloat and get rid of it.
    A couple of weeks ago, I had 20GB left, now I've got 14GB, and I don't know what I've done to get there. I've done the "get info" thing on various folders, but haven't found any that are particularly bloated.
    Is there an app (preferably freeware, natch.) that can search for apps/files/folders by size? Or is this a capability that's already in Tiger?
    Thanks!

    You can also use Terminal to find big directories.
    The following command finds the top-10 directories:
    du -S | sort -nr | head
    Please note that I am using the fink version of du.
    Dual G5 @ 2GHz   Mac OS X (10.4.5)  

  • Mac Lock Files on Windows File Server.

    Hi Pro,
    got some problem with Mac based design studio who have some weird issues with files locking on a Windows Server 2008 R2 server. After investigation, it is 100% a file locking issue. Some programs including preview, acrobat, indesign, finder or opening files (assuming locking them) and not releasing. Killing all the programs or remounting the share is working (releasing all lock files) but it's only a workaround not a fix. Do you any hints ? or Solutions ? all 10.7.3 Mac, using SMB protocol on a windows 2008 R2 File server.
    Thanks to all !!!

    yeah try this ... sorry french blog .. try google translate:
    http://clickpom.com/blog/mac-finder-lock-files-on-windows-server-smb-shared/
    this fix the issue for my client

  • Using AppleScript to find specific text in mail message?

    I'm new to scripting, and I'm a bit lost on this one...
    Is there any way to use AppleScript to find a file name from within the body of a mail message so it can be used later in the script?
    Specifically, I want to use AppleScript to "read" the content of a mail message and look for a paragraph that says "Filename: MyFileName" so I can set "MyFileName" as a variable. (There will always be a paragraph that begins with "Filename: " in this particular email message.)
    This will part of a larger script that uses Fetch to download "MyFileName" from our FTP server.
    Thanks in advance for any ideas - I'm struggling with this one.
    Andy Gill

    Ok, red_menace above me had a shorter and more elegant solution to the question, I'm adding this just for another example.
    To solve your problem I'd make a mail rule that looked for any messages with "Filename:" in them (along with whatever criteria you wanted, like sender, domain, etc). The mail rule would execute the Applescript. My assumption is that the "Filename:foobar" text could be anywhere in the email, not necessarily the first thing in a paragraph, so I had to parse it differently.
    The results end up in a datalist, (theFilename {} ) that you can parse later to collect all filenames found in whatever messages were processed.
    I realize this could be cleaner, hope it's not hard to follow, but I did it really fast. It works flawlessly for me, picking out the name of the file no matter where in the email it appears.
    using terms from application "Mail"
    on perform mail action with messages theSelectedMessages for rule theRule
    repeat with aCounter from 1 to count theSelectedMessages
    set theMessage to item aCounter of theSelectedMessages
    set theContent to content of theMessage
    set theWords to every word of theContent
    set theFilename to {}
    set tid to AppleScript's text item delimiters
    set AppleScript's text item delimiters to ":"
    repeat with thisLoop in theWords
    try
    if (text item 1 of thisLoop) is "Filename" then
    set end of theFilename to (text item 2 of thisLoop)
    -- rest of your logic goes here the display is just to show it finds the filename, take it out!
    display dialog theFilename ¬
    buttons {"OK"}
    end if
    end try
    end repeat
    set AppleScript's text item delimiters to tid
    end repeat
    end perform mail action with messages
    end using terms from
    Message was edited by: stephen.bradley Typos for the win!

  • Encrypt foler using Terminal fail?

    I followed the instruction on this website which teaching ppl how to zip & encrypt a file or a folder using terminal.
    I have successfully zip & encrypt a folder with a file inside; however, when I tried to zip & encrypt a folder that has many files and subfolders, it failed.
    I am not sure what I did wrong. Can anyone please help?!
    *** the size of the folder is 18.8 GB
    Below is the image what I did using Terminal for reference:

    Zip file encryption is not the best option. If the files are only going to be accessed on your Mac (or on any Mac), then your best bet would be to use an encrypted disk image, which can be set up by opening Disk Utility and then choosing File > New > Disk Image from folder. In here you will have options to encrypt the new image, and also compress it to save space. This will serve the same purposes as zipping the files, but also give you better security and a more robust container for the files on Mac systems.

  • After trying to change permissions on my computer so others on my network can access files, my external Hard Drive has a lock on it and I can't access files. I've tried repairing permissions, logging in under another Administrator account, using Terminal

    After trying to change permissions on my computer so others on my network can grab files, my external Hard Drive has a lock on it and I can't access files. I've tried repairing permissions, logging in under another Administrator account, using Terminal to fix the problem, downloaded BatChmod but nothing works… Any other suggestions? I have an Imac running OS10.6.8.

    There is suddenly a lock icon on my external backup drive!
    Custom Permissions

Maybe you are looking for

  • File not opening in orion

    Hi all, I have placed a1.jsp file inside default- web- app folder of orion. but it is not showing the content of file. when I type the following url in the browser http://localhost/a1.jsp please help Amitindia

  • Why can't we replace the WLAN card on Satellite L670?

    Hi, I'm using a Sattelite L670-143 PSK3EE which comes with a default Atheros AR9285 wireless network adapter. I've tried replacing this one with the 5Ghz Intel Centrino Advanced-N 6230, which has a 2pin connection too. Unfortunatelly, the card is bei

  • Issue in installing JDK 1.6

    Hi experts ! i am trying to install JDK 1.6 on x86 64 bit machine with RHEL 5.4 however, when i run the bin file using "./" command from root user, i get following error :- [root@oim2 setups]# ./jdk-6u24-linux-x64.bin Unpacking... Checksumming... Ext

  • Information about Microsoft.ResourceManagement.Automation.ObjectModel schema

    Hi all, Does it exist somewhere some references about the classes under Microsoft.ResourceManagement.Automation.ObjectModel ? On MSDN it only exist references for : Microsoft.IdentityManagement.WebUI.Controls Microsoft.ResourceManagement.WebServices.

  • Music AND movie on same page??

    I have a page that plays music automatically when you open the page. Now I would like to add a small movie clip to the page. But then you hear the music AND the movie.....any other suggestions? Can I get the music to pause while the movie plays and t