Find the answer to your Linux question:
Results 1 to 4 of 4
Does anyone know of a trick or tool that will show me the numeric mode of a file or directory? Example: neatcmd.bash /dir1/dir2/file1 /dir1/dir2/file1 permissions are 0640 Or does anyone ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15

    getting file or dir modes before chmod

    Does anyone know of a trick or tool that will show me the numeric mode of a file or directory?

    Example:

    neatcmd.bash /dir1/dir2/file1

    /dir1/dir2/file1 permissions are 0640


    Or does anyone know of a tool or command what would convert, for example rwxr-x--- to 0750

    I suppose it could be scripted, but I was trying to make sure I did not have to re-invent the wheel if something was already out there.

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    Code:
    stat --format="%a" <FILE>
    stat --format="%A" <FILE>
    stat --format="%a%A" <FILE>
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    Irithori

    Bis Balt

    That command is SWEEEETTTT.

    Dude you are on my Christmas list.

    Danke

    George

  4. #4
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,100
    Hey, I didnt write it.
    But I´m glad it works for you.

    p.s.:
    "Bis bald"
    Last edited by Irithori; 01-28-2011 at 07:17 PM.
    You must always face the curtain with a bow.

Posting Permissions

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