Understanding long (Freelance web design) format file listingsRemember those detailed list

Understanding long format file listingsRemember those detailed list views in the file managers? They typically con- tain information similar to this ls -laoutput here (see Appendix A for a listof commonly used commands in Linux): drwx—— 2 dee dee 4096 Jul 29 07:48 . drwxr-xr-x 5 root root 4096 Jul 27 11:57 .. -rw-r–r– 1 dee dee 24 Jul 27 06:50 .bash_logout-rw-r–r– 1 dee dee 230 Jul 27 06:50 .bash_profile-rw-r–r– 1 dee dee 124 Jul 27 06:50 .bashrcYou may find some parts of this format easier to understand, at a glance, thanothers. The first item in each listing (the part with the letters and dashes for example, the drwx——in the first line) is the permission setassignedto the item. Briefly, permissions define who can read the file, change it, or runit if it s a program. You can read more about permissions in A permissionsprimer, later in this chapter. The second item in the first line (in this case, 2) is the number of links to the item. A linkis a fake file listing that points to another file, making a kind of short- cut. You use two kinds of links in Linux and Unix: Soft link:This link is like a Windows shortcut in that the link points backto the original file, and anything you do to the link happens to the origi- nal file. Erase the original file, and the link remains, but it becomes unus- able. The link is broken without the original file. Hard link:This link doesn t have a counterpart in the Windows world. A hard link isn t just a shortcut; it s another instance of the file itself. The data in this file is saved in only one place, but you can edit eitherthe original or the link, and the edit is saved for both instances of thefile. Erase the original, and the file still exists as long as the link is there. It s like two doors to the same room! The third item (dee) is the file s owner, and the fourth (dee) is the group depending on which version of Linux you re using, both these items may ormay not be identical. You can find out more about both of these in A permis- sions primer, later in this chapter. The fifth item is the file s size in bytes. Alldirectories show up as 4,096 bytes. Everything else has its own size. You cantell an empty file from the size of 0 bytes. The sixth, seventh, and eighth entries are all related to the last time the filewas changed: the month (Jul), the date (29), and the time in 24-hour format(07:48). Finally, the ninth item is the filename (for example, bash logout, inthe third row). 210Part III:Getting Up to Speed with Linux

Leave a Reply