El comando getfacl se usa para recuperar las ACL de archivos y directorios.
El formato de salida básico del comando getfacl muestra metadatos sobre el objeto, incluidos su propietario, su grupo, cualquier conjunto de indicadores de SUID/SGID/sticky bit, los permisos estándar asociados con el objeto y las entradas de permisos individuales para usuarios y grupos.
Una ACL que establece permisos para un usuario específico.
Ejemplos de comandos getfacl
1. Para obtener las ACL de un archivo:
# getfacl /tmp/file.txt
2. Para mostrar la lista de control de acceso a archivos:
# getfacl -a /tmp/file.txt # getfacl --access /tmp/file.txt
3. Para mostrar la lista de control de acceso predeterminada:
# getfacl -d /tmp/file.txt # getfacl --default /tmp/file.txt
4. Para evitar mostrar el encabezado del comentario:
# getfacl -c /tmp/file.txt # getfacl --omit-header /tmp/file.txt
5. Para imprimir todos los comentarios de derechos efectivos:
# getfacl -e /tmp/file.txt # getfacl --all-effective /tmp/file.txt
6. Para evitar la impresión de derechos efectivos:
# getfacl -E /tmp/file.txt # getfacl --no-effective /tmp/file.txt
7. Para omitir archivos que solo tienen las entradas ACL base:
# getfacl -s /tmp/file.txt # getfacl --skip-base /tmp/file.txt
8. Para enumerar las ACL de forma recursiva:
# getfacl -R /tmp # getfacl --recursive /tmp
9. Para seguir los enlaces simbólicos:
# getfacl -L /tmp/file.txt # getfacl --logical /tmp/file.txt
10. Para evitar seguir los enlaces simbólicos:
# getfacl -P /tmp/file.txt # getfacl --physical /tmp/file.txt
11. Para obtener el formato de salida tabular:
# getfacl -t /tmp/file.txt # getfacl --tabular /tmp/file.txt
12. No elimine los caracteres de barra inclinada:
# getfacl -p /tmp/file.txt # getfacl --absolute-names /tmp/file.txt
13. Para enumerar los ID numéricos de usuario y grupo:
# getfacl -n /tmp/file.txt # getfacl --numeric /tmp/file.txt
14. Para obtener la versión de getfacl:
# getfacl -v # getfacl -version
15. Para obtener ayuda para getfacl:
# getfacl -h # getfacl --help