Lsattr
Encyclopedia
lsattr is a command-line program for listing the attributes on a Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

 second extended file system (ext2). It is also a command to display attributes of devices on an AIX operating system
AIX operating system
AIX AIX AIX (Advanced Interactive eXecutive, pronounced "a i ex" is a series of proprietary Unix operating systems developed and sold by IBM for several of its computer platforms...

.

Options

The form of the lsattr command (gnu 1.41.3):


lsattr [ -RVadv ] [ files... ]

  • -R Recursively list attributes of directories and their contents.
  • -V Display the program version.
  • -a List all files in directories, including files that start with '.'
  • -d List directories like other files, rather than listing their contents.
  • -v List the file’s version/generation number.

Attributes

Some attributes include:
  • don't update atime
    Stat (Unix)
    stat is a Unix system call that returns useful data about a file inode. The semantics of stat vary between operating systems. As an example, the Unix command ls uses it to retrieve information on : time of last modification , time of last status change and time of last access .-stat functions and...

     (A)
  • synchronous
    Data synchronization
    Data synchronization is the process of establishing consistency among data from a source to a target data storage and vice versa and the continuous harmonization of the data over time. It is fundamental to a wide variety of applications, including file synchronization and mobile device...

     updates (S)
  • synchronous directory updates (D)
  • append only (a)
  • compressed
    Data compression
    In computer science and information theory, data compression, source coding or bit-rate reduction is the process of encoding information using fewer bits than the original representation would use....

     (c)
  • no dump (d)
  • immutable (i)
  • data journaling
    Journaling file system
    A journaling file system is a file system that keeps track of the changes that will be made in a journal before committing them to the main file system...

     (j)
  • secure deletion (s)
  • top of directory hierarchy (T)
  • no tail-merging (t)
  • undeletable (u)
  • use hashed b-trees
    B-tree
    In computer science, a B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree is a generalization of a binary search tree in that a node can have more than two children...

     for directory lookups (I)
Details of the attributes can be found in the chattr
Chattr
chattr is a command in the Linux operating system that allows a user to set certain attributes on a file residing on an ext2-based filesystem. chflags is the analogous command on modern BSD systems, including Mac OS X. The commands are similar to the attrib command on DOS, OS/2 and Microsoft Windows...

man page

Example output on AIX

Example output of lsattr -El hdisk10:

  1. lsattr -El hdisk10

clr_q yes Device CLEARS its Queue on error True
location Location Label True
lun_id 0x3e000000000000 Logical Unit Number ID False
lun_reset_spt yes FC Forced Open LUN True
max_transfer 0x40000 Maximum TRANSFER Size True
node_name 0x5006048ad52e3f66 FC Node Name False
pvid none Physical volume identifier False
q_err no Use QERR bit True
q_type simple Queue TYPE True
queue_depth 16 Queue DEPTH True
reserve_lock yes Reserve Device on open True
rw_timeout 40 READ/WRITE time out value True
scsi_id 0xd40018 SCSI ID False
start_timeout 180 START UNIT time out value True
ww_name 0x5006048ad52e3f66 FC World Wide Name False
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK