Linux command
lsattr 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
List
lsattr
Example
lsattr path/to/file
Recursive
lsattr -R
Example
lsattr -a
Example
lsattr -d [path/to/dir]
Example
lsattr -l [path/to/file]
Example
lsattr -v [path/to/file]
说明
lsattr lists file attributes on Linux ext2/ext3/ext4 filesystems. It shows special attributes like immutable, append-only, and other extended attributes set by chattr.
参数
- -R
- List attributes recursively
- -a
- List all files including hidden ones
- -d
- List directories themselves, not their contents
- -v
- List file's version/generation number
- -p
- List file's project number
- -l
- Use long names instead of single character abbreviations
- -V
- Display the program version
FAQ
What is the lsattr command used for?
lsattr lists file attributes on Linux ext2/ext3/ext4 filesystems. It shows special attributes like immutable, append-only, and other extended attributes set by chattr.
How do I run a basic lsattr example?
Run `lsattr` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -R do in lsattr?
List attributes recursively