Share on Facebook Share on Twitter Email
Answers.com

Chattr

 
Wikipedia: Chattr
 

chattr is a Linux command that allows a user to set certain attributes on a file. Mostly chattr is used to make files immutable so that password files and certain system files cannot be erased during software upgrades.[1] It is analogous to the attrib command on DOS, OS/2 and Microsoft Windows operating systems, and chflags on modern BSD systems (including Mac OS X). Other Unix systems have no analogous commands; Solaris supports extended file attributes, but there are no user level commands for setting or changing them, and the chatr command in HP-UX, and chattr in AIX have unrelated functions.

Contents

Syntax

The form of the chattr command is:

chattr [-RV] [-+=AacDdijsSu] [-v version] files

where

  • -R is to recurse all subdirectories
  • +i is to set the immutable bit to prevent even root from erasing or changing the contents of a file.

Note: The superuser can't erase or write on the file, but he or she can set or unset the i attribute.

Attributes

Some attributes include:

  • don't update atime (A)
  • synchronous updates (S)
  • synchronous directory updates (D)
  • append only (a)
  • secure deletion (s)
  • top of directory hierarchy (T)
  • no tail-merging (t)
  • undeletable (u)

See also

  • lsattr – view file attributes
  • chown – change file/directory ownership
  • chmod – change file access control attributes
  • cacls – Microsoft Windows NT file system ACL control utility

Notes

  1. ^ chflags(1) – OpenBSD General Commands Manual

References


Search unanswered questions...
Enter a word or phrase...
All Community Q&A Reference topics
 
 
Learn More
Lsattr
Stand-alone shell
Orlov block allocator

Post a question - any question - to the WikiAnswers community:

 

Copyrights:

Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Chattr" Read more