intro-linux

Page 40

Chapter 3. About files and the file system After the initial exploration in Chapter 2, we are ready to discuss the files and directories on a Linux system in more detail. Many users have difficulties with Linux because they lack an overview of what kind of data is kept in which locations. We will try to shine some light on the organization of files in the file system. We will also list the most important files and directories and use different methods of viewing the content of those files, and learn how files and directories can be created, moved and deleted. After completion of the exercises in this chapter, you will be able to: ♦ Describe the layout of a Linux file system ♦ Display and set paths ♦ Describe the most important files, including kernel and shell ♦ Find lost and hidden files ♦ Create, move and delete files and directories ♦ Display contents of files ♦ Understand and use different link types ♦ Find out about file properties and change file permissions

3.1. General overview of the Linux file system 3.1.1. Files 3.1.1.1. General A simple description of the UNIX system, also applicable to Linux, is this: "On a UNIX system, everything is a file; if something is not a file, it is a process." This statement is true because there are special files that are more than just files (named pipes and sockets, for instance), but to keep things simple, saying that everything is a file is an acceptable generalization. A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files. Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system. In order to manage all those files in an orderly fashion, man likes to think of them in an ordered tree-like structure on the hard disk, as we know from MS-DOS (Disk Operating System) for instance. The large branches contain more branches, and the branches at the end contain the tree's leaves or normal files. For now we will use this image of the tree, but we will find out later why this is not a fully accurate image. 3.1.1.2. Sorts of files Most files are just files, called regular files; they contain normal data, for example text files, executable files or programs, input for or output from a program and so on.

Chapter 3. About files and the file system

32


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.