LINUX

LINUX LSATTR指令

介紹

lsattr指令用來列出檔案(夾)的特殊屬性。

語法

lsattr [options] [files]
Code language: plaintext (plaintext)

常用的options

-R Recursively process directories. -a List all files, including those whose names begin with a dot. -d If listing a directory, do not list its contents, just the directory itself.
Code language: plaintext (plaintext)

範例

如果你有用chattr指令來指定特殊屬性的話,可以使用lsattr指令來查看:

⤍ lsattr myfile ----i--- myfile // 代表有Immutable屬性
Code language: plaintext (plaintext)

沒有指定檔名則會列出當前目錄所有檔案的屬性:

⤍ lsattr ...
Code language: plaintext (plaintext)

發佈留言