Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In linux, ls -l lists files permissions, like this:

-rw-r--r--  1 user user      924 2011-07-01 20:23 test.txt

In Windows, commands tree and dir don't have the options to list permissions. How is it possible to list files and their permissions using commandline only?

share|improve this question
add comment

2 Answers

up vote 17 down vote accepted

Use icacls:

> icacls Music
Music SNOW\grawity:(I)(F)
      CREATOR OWNER:(I)(OI)(CI)(IO)(F)
      SNOW\grawity:(I)(OI)(CI)(IO)(F)
      NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)

The older cacls tool is the only choice on Windows XP [although you can copy icacls.exe from Server 2003]. cacls does not know about some ACL modes, but displays most of them fine.

> cacls Music
F:\Users\Mantas\Music SNOW\grawity:F
                      CREATOR OWNER:(OI)(CI)(IO)F
                      SNOW\grawity:(OI)(CI)(IO)F
                      NT AUTHORITY\SYSTEM:(OI)(CI)F

In both outputs, (OI) means "object inherit" (files will inherit this ACE), (CI) is "container inherit" (containers – i.e. folders – will inherit this ACE), (IO) is "inherit only".

Microsoft also used to provide an xcacls tool separately, but its functionality is now part of icacls.

share|improve this answer
add comment

You can use Powershell and the get-acl command

PS C:\> Get-Acl

   Directory:

Path              Owner                            Access  
----              -----                            ------  
C:\               NT SERVICE\TrustedInstaller      Everyone Allow  FullControl

Use it in conjunction with get-childitem (aliased with dir) to get the permissions for the files.

PS C:\> Get-ChildItem | Get-Acl

Or, using the alias:

PS C:\> Dir | Get-Acl
share|improve this answer
    
PS C:\> Get-Acl | fl for a nicer list. –  AWippler Dec 2 '13 at 17:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.