lsattr
file attributesLinux
The lsattr command is one of the most frequently used commands in Linux/Unix-like operating systems. lsattr List file attributes on a Linux file system
Quick Reference
Command Name:
lsattr
Category:
file attributes
Platform:
Linux
Basic Usage:
lsattr [options] [arguments]
Common Use Cases
Syntax
lsattr [options] [files...]
Options
Option | Description |
---|---|
-a |
List all files in directories, including hidden files |
-d |
List directory attributes instead of contents |
-R |
Recursively list attributes of directories and their contents |
-v |
List the file's version/generation number |
-l |
Show attributes using long names instead of one-character flags |
-p |
List the file's project number |
-D |
Show actual flags being set/displayed |
-V |
Display version information |
-h |
Display help information |
Examples
How to Use These Examples
The examples below show common ways to use the lsattr
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
lsattr file.txt