Finding and changing ownership of files by uid

In migrating to a laptop to allow the primary account to be a mobile user on a server, I deleted the user account. Since this user was also the admin for the machine, I now have a series of applications and files on the box which show 501:501 as the owner and group. I can use find to find the files. What I am searching for is the command that would allow me to pipe that to chown so I can modify all these files. Yes I do have a back-up.
Is it something like:
sudo find / -uid 501 | chown admin:admin
And then I could repeat to get the remaining 501 group with:
sudo find / -gid 501 | chown :admin
Thanks!

I suggest using xargs. Use -print0 on 'find' and -0 with xargs (those are zeros).
Something like:
find / -uid 501 -print0 | xargs -0 chown admin:admin
(I didn't fully test it -- ran with 'echo' instead of chown )

Similar Messages

  • Find and change crashing InDesign file

    I'm working on a file and whenever I do a find and replace, it crashes. I recently ran Adobe updater and when I did, the application gave an error that "Scotch Rules" were used on the last saved version and it wasn't loaded on my system. Considering I built this file on my system, I knew I had Scotch Rules. I went into my extension manager and enabled it. This didn't help the crashing. It crashes with this loaded and this not loaded.
    I also trashed my preferences to InDesign using the cmd+opt+cntrl+shift as well as by hand by going to the folders. Nothing is working
    Any ideas?
    Thanks in advance!

    Peter Spier Thanks for replying to another one of my posts. I tried what you suggested here and it didn't work. Actually, I found that when I "saved as" an IDML, it wouldn't save a file at all. It would have a temporary "lock" icon as if making one on the desktop, but no file would finalize and appear. I also reinstalled the applications from the disk image I downloaded through the creative cloud and that didn't solve the problem. I then corrected disk permissions in Apple's Disk Utility. That didn't work either.

  • Interactive Report - is there a way to find and change if necessary the unique column.

    While creating an interactive report I accidently entered the wrong "unique column" on the sql query page.  Is this a big deal and how can I find and change if necessary.
    Query Builder
    Link to Single Row View
    Yes
    No
    Uniquely Identify Rows by
    ROWID
    Unique Column
    Unique Column

    33ac2d45-960f-45af-acba-507f01d18e08 wrote:
    Please update your forum profile with a real handle instead of "33ac2d45-960f-45af-acba-507f01d18e08".
    While creating an interactive report I accidently entered the wrong "unique column" on the sql query page.  Is this a big deal and how can I find and change if necessary.
    Query Builder
    Link to Single Row View
    Yes
    No
    Uniquely Identify Rows by
    ROWID
    Unique Column
    Unique Column
    Yes. You can change this using the Uniquely Identify Rows by/Unique Column properties in the Link Column section on the Report Attributes tab of the interactive report definition.

  • When I connect my iphone to my itunes it says loads of space is being taken up by documents , however i have no documents saved on my phone to my knowledge. how do I find and delete these hidden files ?

    when I connect my iphone to my itunes it says loads of space is being taken up by documents , however i have no documents saved on my phone to my knowledge. how do I find and delete these hidden files ?

    I restored the phone so had no apps on it at all and there was still this certain amount of space used up by documents ! I've already had it in to the apple store and they didn't seem to have a clue either ! Ugh ! Wouldn't mind so much if the phone was free with a contract but I actually spent 450 quid buying this phone and it's always full of "nothing" so virtually unusable

  • How can I hide what I write in a find and change list

    I've written a find and change script, I prepared to offer it for anyone to use, but I don't want to anyone to read what I write in the find and change list.
    How Can I hide it?

    OK, my be offer it for someone to use it, I mean in house coworker, no any virus in it.
    How can hide the find and change list, or change it to another format, not just .txt.
    mybe change it to .doc or .vb or .js, and the script still can run well.

  • Possible bug in inDesign CS5 with find and change

    This could be a problem with my script or it may be a bug, not sure.
    The script is used for finding a double space in a fragment of text and changing it to single space.
    It works only once when it is executed.
    To make it work again you have to close and reopen inDesign.
    Here's the code:
    app.findTextPreferences.findWhat = "  ";
    app.changeTextPreferences.changeTo = " ";
    app.documents[0].changeText();

    This one worked, Harbs also works but I think I'll go the unicode grep route for find and change on this one.
    I like the use of the positive lookbehind GREP character. (?<=) 
    thank you

  • How to modify Find and Change indicator?

    I use Find and Change in Applewors 6. At present, this operation finds what is specified but the indicator is colored green and is open, and hard to locate on a page when looking for a single letter. I changed it from its original pale orange to what it is now but now I would like to change it back to something easier to find. But I forgot how I did it and did not make a note. Would appreciate info on how to change this indicator. Thanks

    Neil--
    Thanks for info. I found it under System preferences>Personal>Appearance. You get a lot of choices in color and intensity. I was hoping to change the Find and Change indicator to solid but maybe this is not possible.

  • HELP!! How can I find and delete duplicate mp3 files.

    I have a zillion copies of songs and I want to find and delete duplicate mp3 files. I have used MediaRage to find the duplicate files (16 thousand or so) but it can't delete them. It will take a million yrs to delete them manually. Does anyone know a way to do this quickly or a program that will do this for me. I have a 15 in Powerbook with OS 10.5.3
    Thanks so much if you can help.

    This site: http://dougscripts.com/itunes/ has hundreds of scripts (small programs that do stuff) for iTunes.
    Bound to be something there for you.

  • Can I do a find and replace on .cfm files only and not search .html or .txt?

    Hi.  I'm using Dreamweaver CS4.  I would like to do a find and replace through my site with Dreamweaver but I only want it to search through .cfm files.  Currently it is searching through .html and .txt files along with .cfm.  Is there a way to do a find and replace on just .cfm files?
    - Tom

    You can't do it on just one type of file. However, you can do find and replace in selected files. Ctrl-click to select the targeted files in the Files panel, and then choose Selected Files in Site from the Find In drop-down.

  • Finding and changing privileges

    I bought an external USB to put a large mesh and graphics library (300K+ files) on so I wouldn't have to use my limited internal HD space (MacBookPro). I also run Parallels and I think what happened was that the drive got mounted under XP because now I get a dialog box that says I need to backup the data and reformat the drive. LOT easier said than done. I am getting "insufficient privileges....." messages when trying to move the files to another drive. If I check "ignore ownership" on the drive info dialog I can copy the files to my MBP drive but get the same stupid message trying to copy from there to another drive. Is there anyway to:
    A: Find out WHICH files have the privilege issue?
    B: Change the privileges across the entire drive without having to do it one file at a time?
    C: Any other suggestion to this dilemma?
    Thanks,
    Joe B

    @cuneytoral – the explanation is:
    findText() ( or findGrep() ) are methods that return an array of found texts (formatted text objects).
    So the result with index 0 is the first one found. The last one is the length of the array -1.
    Since the result is of type Array and not Collection, we cannot define a range with the itemByRange() method.
    And also we cannot define the last item as allFoundItems[-1], but to have write this:
    allFoundItems[allFoundItems.length-1].appliedCharacterStyle = myCharacterStyle;
    to address the last found one.
    Say, we want to format the found texts from the second one found to the last one found, we have to loop through the found array:
    We do not start the loop with 0, but with 1:
    for(var n=1;n<allFoundItems.length;n++){
        allFoundItems[n].appliedCharacterStyle = myCharacterStyle;
    Formatting every other of the found texts would be:
    for(var n=0;n<allFoundItems.length;n=n+2){
        allFoundItems[n].appliedCharacterStyle = myCharacterStyle;
    Just to give you some ideas…
    Uwe

  • Text find and change problem in CS3 and CS4 script

    I use the script below to find some text and change into others.
    There is one thing the script can't do it for me.
    Example:
    (g) Management
    (1) that no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (2) that the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    Example:(END)
    I got a lot of topics or points in the passage. And I want to change the space between '(g)' and 'Management' into a tab character. So I revised the plain text file 1text.
    PS: 1text.txt is filled with what to change.
    text {findWhat:"^p(^?) "} {changeTo:"^p(^?)^t"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an en dash.
    The result is:
    (^?)^tManagement
    (^?)^tthat no law which is enacted in the Cayman Islands imposing any tax to be levied on profits, income, gains or appreciation shall apply to the Company or its operations; and
    (^?)^tthat the aforesaid tax or any tax in the nature of estate duty or inheritance tax shall not be payable on or in respect of the shares, debentures or other obligations of the Company.
    PS: ^t is a tab character.
    result (END)
    This is not what I want.
    It should be '(g)^tManagement'.
    PS: ^t is a tab character.
    Please someboady help me out to revised the script below to change the text into what I want. Thanks so much.
    Here is the script.
    //FindChangeByList.jsx
    //An InDesign CS4 JavaScript
    @@@BUILDINFO@@@ "FindChangeByList.jsx" 2.0.0.0 10-January-2008
    //Loads a series of tab-delimited strings from a text file, then performs a series
    //of find/change operations based on the strings read from the file.
    //The data file is tab-delimited, with carriage returns separating records.
    //The format of each record in the file is:
    //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description
    //Where:
    //<tab> is a tab character
    //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use).
    //findProperties is a properties record (as text) of the find preferences.
    //changeProperties is a properties record (as text) of the change preferences.
    //findChangeOptions is a properties record (as text) of the find/change options.
    //description is a description of the find/change operation
    //Very simple example:
    //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.
    //More complex example:
    //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".
    //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences.
    //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped"
    //as shown in the example below:
    //{findWhat:"\\s+"}
    //For more on InDesign scripting, go to http://www.adobe.com/products/indesign/scripting/index.html
    //or visit the InDesign Scripting User to User forum at http://www.adobeforums.com
    main();
    function main(){
    var myObject;
    //Make certain that user interaction (display of dialogs, etc.) is turned on.
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;
    if(app.documents.length > 0){
      if(app.selection.length > 0){
       switch(app.selection[0].constructor.name){
        case "InsertionPoint":
        case "Character":
        case "Word":
        case "TextStyleRange":
        case "Line":
        case "Paragraph":
        case "TextColumn":
        case "Text":
        case "Cell":
        case "Column":
        case "Row":
        case "Table":
         myDisplayDialog();
         break;
        default:
         //Something was selected, but it wasn't a text object, so search the document.
         myFindChangeByList(app.documents.item(0));
      else{
       //Nothing was selected, so simply search the document.
       myFindChangeByList(app.documents.item(0));
    else{
      alert("No documents are open. Please open a document and try again.");
    function myDisplayDialog(){
    var myObject;
    var myDialog = app.dialogs.add({name:"FindChangeByList"});
    with(myDialog.dialogColumns.add()){
      with(dialogRows.add()){
       with(dialogColumns.add()){
        staticTexts.add({staticLabel:"Search Range:"});
       var myRangeButtons = radiobuttonGroups.add();
       with(myRangeButtons){
        radiobuttonControls.add({staticLabel:"Document", checkedState:true});
        radiobuttonControls.add({staticLabel:"Selected Story"});
        if(app.selection[0].contents != ""){
         radiobuttonControls.add({staticLabel:"Selection", checkedState:true});
    var myResult = myDialog.show();
    if(myResult == true){
      switch(myRangeButtons.selectedButton){
       case 0:
        myObject = app.documents.item(0);
        break;
       case 1:
        myObject = app.selection[0].parentStory;
        break;
       case 2:
        myObject = app.selection[0];
        break;
      myDialog.destroy();
      myFindChangeByList(myObject);
    else{
      myDialog.destroy();
    function myFindChangeByList(myObject){
    var myScriptFileName, myFindChangeFile, myFindChangeFileName, myScriptFile, myResult;
    var myFindChangeArray, myFindPreferences, myChangePreferences, myFindLimit, myStory;
    var myStartCharacter, myEndCharacter;
    var myFindChangeFile = myFindFile("/FindChangeSupport/1test.txt")
    if(myFindChangeFile != null){
      myFindChangeFile = File(myFindChangeFile);
      var myResult = myFindChangeFile.open("r", undefined, undefined);
      if(myResult == true){
       //Loop through the find/change operations.
       do{
        myLine = myFindChangeFile.readln();
        //Ignore comment lines and blank lines.
        if((myLine.substring(0,4)=="text")||(myLine.substring(0,4)=="grep")||(myLine.substring(0, 5)=="glyph")){
         myFindChangeArray = myLine.split("\t");
         //The first field in the line is the findType string.
         myFindType = myFindChangeArray[0];
         //The second field in the line is the FindPreferences string.
         myFindPreferences = myFindChangeArray[1];
         //The second field in the line is the ChangePreferences string.
         myChangePreferences = myFindChangeArray[2];
         //The fourth field is the range--used only by text find/change.
         myFindChangeOptions = myFindChangeArray[3];
         switch(myFindType){
          case "text":
           myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "grep":
           myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
          case "glyph":
           myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions);
           break;
       } while(myFindChangeFile.eof == false);
       myFindChangeFile.close();
    function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change preferences before each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    var myString = "app.findTextPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    myFoundItems = myObject.changeText();
    //Reset the find/change preferences after each search.
    app.changeTextPreferences = NothingEnum.nothing;
    app.findTextPreferences = NothingEnum.nothing;
    function myFindGrep(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change grep preferences before each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    var myString = "app.findGrepPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGrepPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGrepOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGrep();
    //Reset the find/change grep preferences after each search.
    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences = NothingEnum.nothing;
    function myFindGlyph(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
    //Reset the find/change glyph preferences before each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    var myString = "app.findGlyphPreferences.properties = "+ myFindPreferences + ";";
    myString += "app.changeGlyphPreferences.properties = " + myChangePreferences + ";";
    myString += "app.findChangeGlyphOptions.properties = " + myFindChangeOptions + ";";
    app.doScript(myString, ScriptLanguage.javascript);
    var myFoundItems = myObject.changeGlyph();
    //Reset the find/change glyph preferences after each search.
    app.changeGlyphPreferences = NothingEnum.nothing;
    app.findGlyphPreferences = NothingEnum.nothing;
    function myFindFile(myFilePath){
    var myScriptFile = myGetScriptPath();
    var myScriptFile = File(myScriptFile);
    var myScriptFolder = myScriptFile.path;
    myFilePath = myScriptFolder + myFilePath;
    if(File(myFilePath).exists == false){
      //Display a dialog.
      myFilePath = File.openDialog("Choose the file containing your find/change list");
    return myFilePath;
    function myGetScriptPath(){
    try{
      myFile = app.activeScript;
    catch(myError){
      myFile = myError.fileName;
    return myFile;

    It takes me a lof of time to comprehend the sentence you write. Cause I am a Chinese. My poor English.
    I have to say "you are genius". I used to use the indesign CS2. There is no GREP function in CS2. When I get the new script, I do not know how to use it. Just when I saw the
    'grep {findWhat:"  +"} {changeTo:" "} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces.'
    Being confused.
    Thanks so much. It seems I have to relearn the advanced Indesign.

  • How to find and edit an .htaccess file?

    I trying to set up a podcast/blog in WordPress, and I need to edit an .htaccess file.
    I use Fetch as my FTP client to access my web site's hosting account, and I can see that there's an .htaccess file there. I need to get it and add a couple lines of code to it to do a URL redirect.
    When I use Fetch to "Get" it, it appears to download okay, but then I can't see it on my desktop or doing a search. I just downloaded EasyFind, on the advice given in another thread, but now I'm wondering, even if I can find the thing, whether I'm going to be able to edit it.
    Anybody got experience with this?
    Dave

    After I posted my inquiry, I solved the problem. Here it is, step-by-step, for somebody wanting a simple solution:
    1. Download EasyFind from this location: http://www.versiontracker.com/dyn/moreinfo/macosx/11706
    2. Launch EasyFind; make sure the option to show hidden files is checked on; and then search for .htaccess. It should show up in a list of all hidden files in wherever you're looking (Desktop or wherever).
    3. I double-clicked on .htaccess in EasyFind, and this opened the file in TextEdit. I edited the .htaccess file by adding the command info I needed (in my case, a redirect command). Then I did a simple "Save" command (not Save As...). This saved the edited version as .htaccess (hidden).
    4. I launched Fetch, and clicked "Put." In the Put dialog box, there's an option to show hidden files. When I checked that on, there was .htaccess, visible in the list. I selected that and FTPed it to my web server account.
    5. I tested the redirect, and it worked like a charm!
    Thanks very much to Matt Baya for talking me through some of this, including how to change the .htaccess to do my redirect.
    Dave

  • Find and Save a SIS File

    I need to find a SIS file namely MapsBooster sif  for a widget i downloded from the Ovi Store .
    App shows as installed SIS in PC Suite but i am unable to find on phone  using x- browser and ybrowser .
    All i can find is MapsBooster .``dcf  file and any attempt to run/install this file tells me its locked .
    I am able to backup all my other installs bar this one .
    I have to contact OVI store everytime i want to reinstall after wiping the drive .
       jje

    Okay, just a word of warning before I continue: downloading the app from OVI is the preferred method. Onwards then:
    1. Turn off your phone
    2. Turn it on and close all applications
    3. Open a filemanager (any will do)
    4. Browse to E:\
    5. Open Ovi Store and select the application you want
    6. From now BE QUICK!!!
    7. Download the selected application
    8. Immediately after touching "Download" open the taskmanager (any will do) and switch to the filemanager
    9. Open the folder "Installs"
    10. Copy the file to somewhere else
    11. Done
    Normally the phone asks you if you want to install the application so you have enough time to copy that file but sometimes the application is installed without authorization. If this happens just deinstall and download it again.
    If you never find files in E:\Installs you should check your settings in Ovi Store. Open it and select "Options", scroll down to "Account" and select "Settings", then select "Installation Settings". Now you can see (and change) where the downloads are temporarily saved. Change the drive or use the shown one instead of E: mentioned in the guide above.
    There are some file extension used but all are work.. Ovi Store does nothing more than download the file to your device, start the installation and delete the downloaded file after installation is done, thus all files downloaded are useable.
    Usable file extensions: .sis, .sisx, .dm, .wgz (there might be more).
    Good luck.

  • Moving to new PC and changing path to files

    Hi! I'm moving from a Windows XP machine to a new Vista machine. My iTunes library is external on a samba share so the path in my iTunes xml library file is: /Jester/music/ etc... Well, there's some bugs in getting Windows Vista to see Samba shares so I have to view it by IP address. I've mounted that IP address as a drive, so I need to just substitute the above with "M:/". I've tried copying my old library files over. If I leave them intact, iTunes sees the library & rating but can't find the songs (I have 8000+ so I don't want to go refind each one). If I try to change the XML file, iTunes apparently reloads the library from the itl file. I also tried the hack to corrupt the itl file so it would rebuild from the xml file but apparently that doesn't work anymore in iTunes 7, it just reverts back to an empty library. Any suggestions?

    Thought that I would post back and say that I was able to create a Backup for a catalog under PSE 3, which required 4 CDs.
    Then I ran the Restore on the new PC where only PSE 4 is installed. The Restore ran using all 4 CDs and at the end I received the message that the Catalog was from a prior version and needed to be converted. I said OK to the catalog conversion, which ran and then displayed thumbnails in the Photo Browser. When I scrolled thru the photo well there were normal "first time" delays that I attribute to the building of the thumbnails.
    As of now the v4 catalog appears to be updated for the new drive and folder location on this system. The associated photo files seem generally OK, but I am still checking specifics.
    For now I will run with the photo files on the only drive, the system drive. However, eventually I will probably add a second internal or external drive.
    Colin and Chuck, I decided to try the PS Elements functions first and keep your information in reserve in case I discover a problem. However, I am still very grateful for the assistance.
    Barb O

  • How do I find and free the hidden files on external drive?

    I cannot see , or free, space on my external drive.
    It is a Seagate Freeagent 500 GB disk. I am using 100GB for photos and music. Only 38 MB are reported free. How can I reclaim the rest of the space?
    I had used in the past as Time machine backup. To create space I moved to trash the file Backups.backupd (as I now have another disk for Time Machine). I can't see this file in the Trash, and I can't see the space in Finder. How do I find / free the space?
    The disk format is MAC OS Extended journaled. Disk utility reports no errors. I have run verify and fix, and also erase free space, with no result.
    Thank you for your help.

    Erase free space only wipes clean the 38 MBs that are already free. Click here to see hidden files.
    However, I'd just make a copy of the 100 GBs in use, and then complely wipe the disk.
    Don't try to delete the Backups.backupd folder by Finder. It's not a good idea to mix Finder and TM.

Maybe you are looking for