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

lsattr

The command line tool lsattr is used in Linux systems to list and modify the attributes of files and directories. The name "lsattr" stands for "list attributes."

When executed without any arguments, lsattr displays the attributes of the files and directories in the current directory. It shows attributes such as "i" for immutable (cannot be modified or deleted), "a" for append-only (only new data can be added), "c" for compressed, "e" for extent format, and many more.

The -v option can be used to show the version information of the file system. The -R flag enables recursive listing of attributes for all files and directories in the specified directory, including subdirectories.

To modify attributes, the command line option + or - is used followed by the attribute. For example, lsattr +i filename makes the file immutable, while lsattr -a directoryname removes the append-only attribute from the directory.

Root privileges are usually required to make changes to attributes. Proper usage of lsattr helps manage and protect important system files and directories effectively.

List of commands for lsattr:

  • lsattr:tldr:2c49b lsattr: Display the attributes of the files in the current directory.
    $ lsattr
    try on your machine
    explain this command
  • lsattr:tldr:40453 lsattr: Show attributes of all the files in the current directory, including hidden ones.
    $ lsattr -a
    try on your machine
    explain this command
  • lsattr:tldr:520a5 lsattr: Display attributes of directories in the current directory.
    $ lsattr -d
    try on your machine
    explain this command
  • lsattr:tldr:5848a lsattr: List the attributes of files in a particular path.
    $ lsattr ${path}
    try on your machine
    explain this command
  • lsattr:tldr:e5183 lsattr: List file attributes recursively in the current and subsequent directories.
    $ lsattr -R
    try on your machine
    explain this command
tool overview