Difference between ‘getfacl’ and ‘ls -l’

What is the difference between
getfacl and ls -l in Linux?
Both of them produce output with the same content.
Am I wrong?

Answer

From the getfacl(1) man page:

For each file, getfacl displays the file name, owner, the group, and
the Access Control List (ACL). If a directory has a default ACL, get‐
facl also displays the default ACL. Non-directories cannot have default
ACLs.

Basically, getfacl is used to get the filename, the owners, and the file mode in a shell script friendly output. Unlike ls, which is used mainly to list directory contents.

Attribution
Source : Link , Question Author : sunny , Answer Author : yuki_is_bored

Leave a Comment