Professional Web Applications Themes

chmod equivalent to find commands - FreeBSD

hello. i know there's an equivalent to these two find commands that can be summed up in one chmod command: find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; it fixes my permissions ... i haven't tested this yet but i think it's wrong: chmod -R u+rwX,a+rX what would be the best solution here? thanks, -- fafa -- __________________________________________________ _________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm...

  1. #1

    Default chmod equivalent to find commands

    hello.

    i know there's an equivalent to these two find commands that
    can be summed up in one chmod command:

    find . -type d -exec chmod 755 {} \;
    find . -type f -exec chmod 644 {} \;

    it fixes my permissions ...
    i haven't tested this yet but i think it's wrong: chmod -R u+rwX,a+rX

    what would be the best solution here?

    thanks,
    -- fafa

    --
    __________________________________________________ _________
    Sign-up for Ads Free at Mail.com
    http://promo.mail.com/adsfreejump.htm

    Fafa Guest

  2. Moderated Post

    Default Re: chmod equivalent to find commands

    Removed by Administrator
    Eric Guest
    Moderated Post

  3. #3

    Default Re: chmod equivalent to find commands

    In the last episode (Mar 12), Fafa Diliha Romanova said: 

    That chmod command should work just fine.

    --
    Dan Nelson
    com
    Dan Guest

  4. Moderated Post

    Default Re: chmod equivalent to find commands

    Removed by Administrator
    Giorgos Guest
    Moderated Post

  5. #5

    Default Re: chmod equivalent to find commands

    On Sat, Mar 12, 2005 at 06:53:59AM -0500, Fafa Diliha Romanova wrote: 

    The EXACT equivalent would be:

    find . -type d -exec chmod u=rwx,go=rx {} \;
    find . -type f -exec chmod u=rw,go=r {} \;

    But I take it that that isn't exactly what your looking for. Your
    probably looking for something like "chmod -R u=rwX,go=rX ."
     

    This may work it depends on exactly what you need to do and how bad your
    permissions are messed up. Instead of a+rX, it might be better to do
    go+rX since you already have u covered, but I don't think it will make a
    big difference. Also, this adds to the existing permissions, it won't
    take away any permissions like my example earlier does. Lastly, the big
    difference between this and the find version is that the find version,
    both mine and yours, will set the execute bit on all directories and not
    on any normal files where the recursive chmod with the X permission with
    set the x permission on any file/directory that already has at least one
    type of execute permission already set and not on any other files or
    directories. So if your permissions are messed so badly that you have
    directories without any execute permission, this won't fix that. The
    find version on the other hand will ignore everything that is not a
    normal file or directory (i.e. fifos, sockets, device files), but this
    probably won't be a big deal either. The single recursive chmod I gave
    you will most likely be what you need.
     

    --
    I sense much NT in you.
    NT leads to Bluescreen.
    Bluescreen leads to downtime.
    Downtime leads to suffering.
    NT is the path to the darkside.
    Powerful Unix is.

    Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
    Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD4DBQFCNBFIbTXoRwEYo9IRAhgHAJjmpYnalMAfh1psKqCcl2 jlCXN5AJ4ilEWx
    VtrIGvc7LEwKwStnjpQSNw==
    =C1nr
    -----END PGP SIGNATURE-----

    Loren Guest

  6. Moderated Post

    Default Re: chmod equivalent to find commands

    Removed by Administrator
    Loren Guest
    Moderated Post

  7. #7

    Default Re: chmod equivalent to find commands

    On Sun, Mar 13, 2005 at 02:09:12AM -0800, Loren M. Lang wrote: 
    >
    > The EXACT equivalent would be:
    >
    > find . -type d -exec chmod u=rwx,go=rx {} \;
    > find . -type f -exec chmod u=rw,go=r {} \;
    >
    > But I take it that that isn't exactly what your looking for. Your
    > probably looking for something like "chmod -R u=rwX,go=rX ."[/ref]

    And one last thing, I'm assuming your umask is probably 022. When chmod
    doesn't have the u, g, o, or a qualifies, then it uses the umask to mask
    the permission bits as appropriate so the command can be simplified to
    the following:

    chmod -R =rwX .
     
    >
    > This may work it depends on exactly what you need to do and how bad your
    > permissions are messed up. Instead of a+rX, it might be better to do
    > go+rX since you already have u covered, but I don't think it will make a
    > big difference. Also, this adds to the existing permissions, it won't
    > take away any permissions like my example earlier does. Lastly, the big
    > difference between this and the find version is that the find version,
    > both mine and yours, will set the execute bit on all directories and not
    > on any normal files where the recursive chmod with the X permission with
    > set the x permission on any file/directory that already has at least one
    > type of execute permission already set and not on any other files or
    > directories. So if your permissions are messed so badly that you have
    > directories without any execute permission, this won't fix that. The
    > find version on the other hand will ignore everything that is not a
    > normal file or directory (i.e. fifos, sockets, device files), but this
    > probably won't be a big deal either. The single recursive chmod I gave
    > you will most likely be what you need.
    >  
    >
    > --
    > I sense much NT in you.
    > NT leads to Bluescreen.
    > Bluescreen leads to downtime.
    > Downtime leads to suffering.
    > NT is the path to the darkside.
    > Powerful Unix is.
    >
    > Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
    > Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2
    > [/ref]



    --
    I sense much NT in you.
    NT leads to Bluescreen.
    Bluescreen leads to downtime.
    Downtime leads to suffering.
    NT is the path to the darkside.
    Powerful Unix is.

    Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
    Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)

    iD8DBQFCNBMHbTXoRwEYo9IRAjNKAJ9xDsEBL0is2IsPQRUXId Z40/1PcQCcDriF
    fqwR3XVhRub6kkLTmseYBNs=
    =Pt6w
    -----END PGP SIGNATURE-----

    Loren Guest

  8. #8

    Default Re: chmod equivalent to find commands


    Thank you for your kind assistance!

    That was exactly what I was looking for.

    But after the constructive response from many other kind souls
    on this list, I have decided to stick with my find command
    for now and keep your recursive chmod as an alternate.

    I keep a local mirror of all my modified configuration files
    (gives me easy backup and a great deal control over my system).
    I needed this command to quickly change permissions and
    ownership of the homedir I store them in.

    Thanks again!
    -- Fafa

    ----- Original Message -----
    From: "Loren M. Lang" <com>
    To: "Fafa Diliha Romanova" <com>
    Subject: Re: chmod equivalent to find commands
    Date: Sun, 13 Mar 2005 02:09:12 -0800
     
    >
    > The EXACT equivalent would be:
    >
    > find . -type d -exec chmod u=rwx,go=rx {} \;
    > find . -type f -exec chmod u=rw,go=r {} \;
    >
    > But I take it that that isn't exactly what your looking for. Your
    > probably looking for something like "chmod -R u=rwX,go=rX ."

    >
    > This may work it depends on exactly what you need to do and how bad your
    > permissions are messed up. Instead of a+rX, it might be better to do
    > go+rX since you already have u covered, but I don't think it will make a
    > big difference. Also, this adds to the existing permissions, it won't
    > take away any permissions like my example earlier does. Lastly, the big
    > difference between this and the find version is that the find version,
    > both mine and yours, will set the execute bit on all directories and not
    > on any normal files where the recursive chmod with the X permission with
    > set the x permission on any file/directory that already has at least one
    > type of execute permission already set and not on any other files or
    > directories. So if your permissions are messed so badly that you have
    > directories without any execute permission, this won't fix that. The
    > find version on the other hand will ignore everything that is not a
    > normal file or directory (i.e. fifos, sockets, device files), but this
    > probably won't be a big deal either. The single recursive chmod I gave
    > you will most likely be what you need.

    >
    > --
    > I sense much NT in you.
    > NT leads to Bluescreen.
    > Bluescreen leads to downtime.
    > Downtime leads to suffering.
    > NT is the path to the darkside.
    > Powerful Unix is.
    >
    > Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
    > Fingerprint: CEE1 AAE2 F66C 59B5 34CA C415 6D35 E847 0118 A3D2
    >[/ref]
    << 2.dat >>

    --
    __________________________________________________ _________
    Sign-up for Ads Free at Mail.com
    http://promo.mail.com/adsfreejump.htm

    Fafa Guest

  9. Moderated Post

    Default Re: chmod equivalent to find commands

    Removed by Administrator
    Fafa Guest
    Moderated Post

  10. Moderated Post

    Default Re: chmod equivalent to find commands

    Removed by Administrator
    Loren Guest
    Moderated Post

Similar Threads

  1. commands to find types of raid
    By yls177 in forum Linux / Unix Administration
    Replies: 2
    Last Post: September 15th, 02:29 AM
  2. To find the model of a server through commands.
    By yls177 in forum Linux / Unix Administration
    Replies: 3
    Last Post: August 30th, 09:35 AM
  3. Solaris equivalent commands for HP and AIX
    By Dave in forum Linux / Unix Administration
    Replies: 3
    Last Post: February 15th, 03:55 PM
  4. Find out the commands executed
    By Dan in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 21st, 01:28 PM
  5. Unix equivalent of Dos commands
    By justin in forum SCO
    Replies: 8
    Last Post: June 26th, 05:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139