Tomcat web server - 7. File Attributes You cannot link directories
7. File Attributes You cannot link directories to avoid creating loops in the file system. But you can make a symlink point to a directory and use it as if it were actually a directory. Symbolic links are therefore very useful in several circumstances, and very often, people tend to use them to link files together even when a normal link could be used instead. One advantage of normal linking, though, is that you do not lose the file if you delete the original one . Lastly, if you observed carefully, you know what the size of a symbolic link is: it is simply the size of the string. 7. File Attributes The same way that FAT has file attributes (archive, system file, invisible, read- only), a GNU/Linux file system has its own, but they are different. We will briefly go over them here for the sake of completeness, but they are very seldom used. However, if you really want a secure system, read on. There are two commands for manipulating file attributes: lsattr and chattr. You probably guessed it, lsattr LiSts attributes, whereas chattr CHanges them. These attributes can only be set on directories and regular files. The following are some of the attributes possible, for a complete list please refer to chattr(1): 1. A ( no Access time ): if a file or directory has this attribute set, whenever it is accessed, either for reading or for writing, its last access time won’t be updated. This can be useful, for example, on files or directories which are often accessed for reading, especially since this parameter is the only one which changes on an inode when it is open read-only. 2. a ( append only ): if a file has this attribute set and is open for writing, the only operation possible will be to append data to its previous contents. For a directory, this means that you can only add files to it, but not rename or delete any existing file. Only root can set or clear this attribute. 3. d ( no dump ): dump is the standard UNIX utility for backups. It dumps any file system for which the dump counter is 1 in /etc/fstab (see chapter Chapter 32, File Systems and Mount Points [433]). But if a file or directory has this attribute set, unlike others, it will not be taken into account when a dump is in progress. Note that for directories, this also includes all sub-directories and files under it.