Forrest logo
tool overview
On this page you find all important commands for the CLI tool xattr. If the command you are looking for is missing please ask our AI.

xattr

xattr is a command-line tool commonly found in Unix-like operating systems that allows users to manipulate extended attributes of files. These extended attributes are additional pieces of metadata associated with a file that provide extra information beyond the standard file system attributes. The xattr command provides various functions to interact with these extended attributes.

One of the primary uses of xattr is to list the extended attributes attached to a file or directory. By using the appropriate options, users can view all attributes or filter them based on specific criteria. Additionally, xattr allows users to add or remove extended attributes from a file, providing flexibility in modifying the metadata associated with a particular file or directory.

xattr also offers options to copy or transfer extended attributes between files or directories, enabling users to replicate or synchronize attribute information across different locations. Furthermore, the command supports the ability to display the values of extended attributes, providing insights into the content of these attributes.

Some operating systems and file systems provide security-related extended attributes, such as ACLs (Access Control Lists), that allow for fine-grained access control on files and directories. xattr can interact with these security attributes, facilitating the management of access permissions and enhancing security measures on a system.

In summary, xattr is a versatile command-line tool that empowers users to interact with extended attributes of files and directories efficiently, providing the ability to list, add, remove, copy, transfer, and display these additional metadata elements.

List of commands for xattr:

  • xattr:tldr:36d55 xattr: Write an attribute for a given file.
    $ xattr -w ${attribute_key} ${attribute_value} ${file}
    try on your machine
    explain this command
  • xattr:tldr:55369 xattr: Delete an attribute from a given file.
    $ xattr -d ${com-apple-quarantine} ${file}
    try on your machine
    explain this command
  • xattr:tldr:7a229 xattr: List key:value extended attributes for a given file.
    $ xattr -l ${file}
    try on your machine
    explain this command
  • xattr:tldr:a7633 xattr: Recursively delete an attribute in a given directory.
    $ xattr -rd ${attribute_key} ${directory}
    try on your machine
    explain this command
  • xattr:tldr:d92c3 xattr: Delete all extended attributes from a given file.
    $ xattr -c ${file}
    try on your machine
    explain this command
tool overview