{"id":2660,"date":"2010-02-25T01:03:08","date_gmt":"2010-02-25T06:03:08","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=2660"},"modified":"2010-02-25T01:03:08","modified_gmt":"2010-02-25T06:03:08","slug":"linux-file-attributes","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/","title":{"rendered":"Linux file attributes"},"content":{"rendered":"<p style=\"text-align: left;\">A little known aspect of the Linux file system is file attributes. They allow you to utilize certain options which you might think you need other software for, but they&#8217;re actually built into your file system. To view or change these you can use the lsattr and chattr commands. The available attributes are:<\/p>\n<p style=\"text-align: left;\">When a file with the &#8216;A&#8217; attribute set is accessed, its atime record is not modified.  This avoids a certain amount of disk I\/O for laptop systems.<\/p>\n<p style=\"text-align: left;\">A  file  with  the  `a&#8217; attribute set can only be open in append mode for writing.  Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.<\/p>\n<p style=\"text-align: left;\">A file with the `c&#8217; attribute set is automatically compressed on the disk by the kernel.  A read from this file returns uncompressed data.  A write to this  file  compresses data before storing them on the disk.  Note: please make sure to read the bugs and limitations section at the end of this document.<\/p>\n<p style=\"text-align: left;\">When a directory with the `D&#8217; attribute set is modified, the changes are written synchronously on the disk; this is equivalent to the `dirsync&#8217;  mount option applied to a subset of the files.<\/p>\n<p style=\"text-align: left;\">A file with the `d&#8217; attribute set is not candidate for backup when the dump(8) program is run.<\/p>\n<p style=\"text-align: left;\">The  &#8216;E&#8217;  attribute  is used by the experimental compression patches to indicate that a compressed file has a compression error.  It may not be set or reset using chattr(1), although it can be displayed by lsattr(1).<\/p>\n<p style=\"text-align: left;\">The &#8216;e&#8217; attribute indicates that the file is using extents for mapping the blocks on disk.  It may not be removed using chattr(1).<\/p>\n<p style=\"text-align: left;\">The &#8216;I&#8217; attribute is used by the htree code to indicate that a directory is being indexed using hashed trees.  It  may  not  be  set  or  reset  using chattr(1), although it can be displayed by lsattr(1).<\/p>\n<p style=\"text-align: left;\">The  &#8216;h&#8217;  attribute  indicates  the file is storing its blocks in units of the filesystem blocksize instead of in units of sectors, and means that the file is (or at one time was) larger than 2TB.  It may not be set or reset using chattr(1), although it can be displayed by lsattr(1).<\/p>\n<p style=\"text-align: left;\">A file with the `i&#8217; attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be  written  to the file.  Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.<\/p>\n<p style=\"text-align: left;\">A  file  with  the `j&#8217; attribute has all of its data written to the ext3 journal before being written to the file itself, if the filesystem is mounted with the &#8220;data=ordered&#8221; or &#8220;data=writeback&#8221; options.  When the filesystem is mounted with the &#8220;data=journal&#8221; option all file  data  is  already  journalled and this attribute has no effect.  Only the superuser or a process possessing the CAP_SYS_RESOURCE capability can set or clear this attribute.<\/p>\n<p style=\"text-align: left;\">When  a  file  with the `s&#8217; attribute set is deleted, its blocks are zeroed and written back to the disk.  Note: please make sure to read the bugs and limitations section at the end of this document.<\/p>\n<p style=\"text-align: left;\">When a file with the `S&#8217; attribute set is modified, the changes are written synchronously on the disk; this is equivalent to the `sync&#8217;  mount  option applied to a subset of the files.<\/p>\n<p style=\"text-align: left;\">A  directory  with  the  &#8216;T&#8217; attribute will be deemed to be the top of directory hierarchies for the purposes of the Orlov block allocator.  This is a hint to the block allocator used by ext3 and ext4 that the subdirectories under this directory are not related, and thus should be  spread  apart  for allocation  purposes. For example it is a very good idea to set the &#8216;T&#8217; attribute on the \/home directory, so that \/home\/john and \/home\/mary are placed into separate block groups.  For directories where this attribute is not set, the Orlov block allocator will try to group subdirectories closer<br \/>\ntogether where possible.<\/p>\n<p style=\"text-align: left;\">A  file with the &#8216;t&#8217; attribute will not have a partial block fragment at the end of the file merged with other files (for those filesystems which support tail-merging).  This is necessary for applications such as LILO which read the filesystem directly, and which don&#8217;t understand tail-merged files. Note: As of this writing, the ext2 or ext3 filesystems do not (yet, except in very experimental patches) support tail-merging.<\/p>\n<p style=\"text-align: left;\">When a file with the `u&#8217; attribute set is deleted, its contents are saved.  This allows the user to ask for its undeletion.  Note: please make sure to read the bugs and limitations section at the end of this document.<\/p>\n<p style=\"text-align: left;\">The &#8216;X&#8217; attribute is used by the experimental compression patches to indicate that a raw contents of a compressed file can be accessed  directly.   It currently may not be set or reset using chattr(1), although it can be displayed by lsattr(1).<\/p>\n<p style=\"text-align: left;\">The &#8216;Z&#8217; attribute is used by the experimental compression patches to indicate a compressed file is dirty.  It may not be set or reset using chattr(1), although it can be displayed by lsattr(1).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A little known aspect of the Linux file system is file attributes. They allow you to utilize certain options which you might think you need other software for, but they&#8217;re actually built into your file system. To view or change these you can use the lsattr and chattr commands. The available attributes are: When a&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-2660","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Linux file attributes - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux file attributes - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"A little known aspect of the Linux file system is file attributes. They allow you to utilize certain options which you might think you need other software for, but they&#8217;re actually built into your file system. To view or change these you can use the lsattr and chattr commands. The available attributes are: When a... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2010-02-25T06:03:08+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Linux file attributes\",\"datePublished\":\"2010-02-25T06:03:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/\"},\"wordCount\":856,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/\",\"name\":\"Linux file attributes - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2010-02-25T06:03:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/linux-file-attributes\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux file attributes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux file attributes - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/","og_locale":"en_US","og_type":"article","og_title":"Linux file attributes - Linux Shtuff","og_description":"A little known aspect of the Linux file system is file attributes. They allow you to utilize certain options which you might think you need other software for, but they&#8217;re actually built into your file system. To view or change these you can use the lsattr and chattr commands. The available attributes are: When a... Read More","og_url":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2010-02-25T06:03:08+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Linux file attributes","datePublished":"2010-02-25T06:03:08+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/"},"wordCount":856,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/linux-file-attributes\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/","url":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/","name":"Linux file attributes - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2010-02-25T06:03:08+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/linux-file-attributes\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/linux-file-attributes\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Linux file attributes"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/2660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=2660"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/2660\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=2660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=2660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=2660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}