10.1 File Management in Linux |
Linux is the operating system (OS: Operating System) which allows users to manage files directly. Managing files requires the knowledge of hard disk, file system and directory structure.
If you want to use hard disk in Linux, you have to prepare by some commands, so you should know the file system. You have to choose a file system according to the purpose, and prepare the file system by commands.
Let's learn about directory, for example standard directory structure, and its status check commands.
10.1.1 File System
The file system is the mechanism for managing files efficiently. There are some kinds of file system formats which manage file attributes, such as file name, saved date and so on, and file data efficiently. The efficiency and the safety for accessing files, depend on the file system. If you understand the general concept of file system, you can understand the commands already explained, more clearly.
10.1.2 Partition
In order to use, a hard disk is divided into some units which are called partition. Before using a disk, we have to divide the disk into some partitions at the beginning. This disk dividing is called 'partitioning'.
10.1.3 Directory Structure of Linux
If you manage data by files, the number of files will be increasing, and which make it difficult to find the file you want to access. In order to manage those files efficiently, EXT3 file system provides directory like other many file systems do. The directory can manage files collectively, and other directories can be also handled like same. By using directory, you can classify files into directories by purpose. You can also manage more files systematically by hierarchy. The directory structure of UNIX systems including Linux is a tree structure from which the / directory is origin.
- / directory
'/ directory' is called 'root directory', and is the origin of the tree structure. All of files and directories exist under '/ directory',.
- Mount
In order to use disk (hard disk, DVD-ROM drives, memory space, etc.), you should mount its first one to the / directory.
When using two or more disks, you should mount the second or its later disk, to the directory in the already mounted disk. (If a disk is mounted to the directory which already has contents, the contents will be replaced by new contents. It happens even if it is / directory, and it means old contents can not be accessed.)
Column: FHS(Filesystem Hierarchy Standard) |
|
10.1.4 How to create File System
We can use new hard disk by following procedures.
- Create partitions - - - fdisk command
- Create file systems - - - mkfs command
- Mount - - - mount command
The command which comes out henceforth is a command for system managements in a /sbin directory. Many system management commands should be run by the root user (after becoming an administrator). Since there is no authority of system management, the general users cannot execute the command for system managements, or even if they can execute the command for system management, they cannot access required resources (hard disk etc.). Moreover, by initial setting, general users do not have command path to /sbin of commands for system management, they have to use absolute path(description from the / directory) like /sbin/fdisk.
Please reconfirm that when prompt is '#', the command requires root user. If you are a general user, please execute the command after becoming the root user by using "su [ - ]" command.
The detailed explanation of the commands will be done later.
Column: Terminological differences from Windows |
|