• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

getfacl Command Examples in Linux

by admin

The getfacl command is used to retrieve the ACLs of files and directories.

The basic output format of the getfacl command shows metadata about the object including its owner, its group, any SUID/SGID/sticky bit flags set, the standard permissions associated with the object, and the individual permission entries for users and groups.

An ACL that sets permissions for a specific user.

getfacl command output

getfacl Command Examples

1. To get the ACL’s of a file:

# getfacl /tmp/file.txt 

2. To display the file access control list:

# getfacl -a /tmp/file.txt
# getfacl --access /tmp/file.txt 

3. To display the default access control list:

# getfacl -d /tmp/file.txt
# getfacl --default /tmp/file.txt 

4. To avoid displaying comment header:

# getfacl -c /tmp/file.txt
# getfacl --omit-header /tmp/file.txt 

5. To Print all effective rights comments:

# getfacl -e /tmp/file.txt
# getfacl --all-effective /tmp/file.txt 

6. To avoid printing effective rights:

# getfacl -E /tmp/file.txt
# getfacl --no-effective /tmp/file.txt 

7. To skip files that only have the base ACL entries:

# getfacl -s /tmp/file.txt
# getfacl --skip-base /tmp/file.txt 

8. To list the ACL’s recursively:

# getfacl -R /tmp
# getfacl --recursive /tmp 

9. To follow the symbolic links:

# getfacl -L /tmp/file.txt
# getfacl --logical /tmp/file.txt 

10. To avoid following the symbolic links:

# getfacl -P /tmp/file.txt
# getfacl --physical /tmp/file.txt 

11. To get the tabular output format:

# getfacl -t /tmp/file.txt
# getfacl --tabular /tmp/file.txt 

12. Do not strip leading slash characters:

# getfacl -p /tmp/file.txt
# getfacl --absolute-names /tmp/file.txt 

13. To list the numeric user and group IDs:

# getfacl -n /tmp/file.txt
# getfacl --numeric /tmp/file.txt 

14. To get the version of the getfacl:

# getfacl -v
# getfacl -version 

15. To get the help for getfacl:

# getfacl -h
# getfacl --help 

Filed Under: Linux

Some more articles you might also be interested in …

  1. Understanding Ksplice Effective Kernel Version
  2. “You must wait longer to change your password” – error while changing password in CentOS/RHEL
  3. “Read-only locking type set. Write locks are prohibited. Can’t get lock for [volume group]” – error during lvextend
  4. Issue Opening a Firewalld Port in CentOS/RHEL 8
  5. How to Convert a Directory to Partition in Linux
  6. How to create virtual block device (loop device/filesystem) in Linux
  7. CentOS / RHEL : Resize (reduce) non-root EXT3/4 filesystem on non-LVM device (hard disk partition)
  8. How to burn an ISO to CD or DVD using Wodim
  9. What are sparse files in Linux
  10. XFS error: Unable to mount filesystem With Noacl Permission in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • What are /dev/zero and /dev/null files in Linux
  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright