Identifying the basics of linux

Identifying the basics of Linux

Identifying the Linux file system:

Thousands of files can be stored on a single fixed disc. To organize data by grouping files on the disk, operating systems provide a file system.

When UNIX was developed, several features were introduced in it. One such feature was its file system. The UNIX file system has a hierarchical structure and files can be stored in directories. An analogy can be drawn between these directories and the drawers of a filing cabinet. Just as each drawer contains files, each of which contains documents of a similar nature, the directories on the disk can be created to store files containing data of a similar nature. Linux adheres to the UNIX file system standard.

The following figure depicts a sample Linux hierarchical file system structure.


All the files are stored on the disk in one main directory, / (root). The directory, I, has been further subdivided into directories, such as bin, boot, home, etc, us, and dev. In each directory, files containing related data can be stored. The administrator of the Linux system may place all the home directories of the users in the home directory. For example, the directory, tom, is the home directory for the user, tom. He will store all his files in his home directory, tom, or create new directories in it.

The directory, tom, contains two files, namely Program1 and Program2, and two directories, Desktop and Template. The Desktop directory contains two files, Default, and Start.

A file is identified in the file system hierarchy by its path name, which is composed of the file name followed by the name of the directory housing the file. Until the / directory is reached, the path name may contain a number of directories, each of which contains another. The / sign divides the path's file name and various directory names.

For instance, in the previous figure, the full path of the file, start, can be given as /home/tom/Desktop/start.

Similarly, the path for the file, Is, is /bin/Is. As you notice, the / is a special character, and therefore, it cannot be included in a file or a directory name.
in a hierarchical inverted tree-like structure, the operating system provides rapid access to cause.

Groups of files are isolated from each other. Only one directory (a smaller number of files) has to be searched to locate a file. On the other hand, if there were no subdirectories and all the files were stored in the files located.

directory, 1, then locating a file would have meant searching through the entire list of files until the required The hierarchical inverted tree file system of Linux is also found in MS-DOS. There is, however, a major difference between the MS-DOS and Linux file systems. Linux consists of hundreds of files that are provided along with a Linux-based system. Conversely, MS-DOS consists of only three files. When you install Linux, it creates a number of directories and subdirectories to store the operating system files. Thus, unlike MS-DOS, Linux enforces the hierarchical file system. MS-DOS is much smaller than Linux in terms of storage requirements.

Some of the directories in the / directory are:

  • The /bin directory: It stores many utilities of Linux. These utilities are the commands available in the Linux system. They are in the binary format, hence the name bin.

  • The /dev directory: It stores all the device-related files for the system.
  • The /etc directory: It stores the system-related data that the users and the system need to refer to, such as the passwd file. These are generally the essential miscellaneous system programs and configuration files.
  • The /lib directory: It contains libraries of data for the compilers installed on the system, such as the C language routines.
  • The /home directory: It contains all the home directories of users.
  • The /usr directory: It stores the operating systems files, which are not involved in the boot process Many utilities are available in the bin directory in the us directory. The /ust/bin directory is different from the /bin directory.
  • The /var directory: It has information specific to different utilities of Linux.
Each of these directories has been organized to store a specific type of file.

Type of files in Linux:

in Linux, all information is considered as a file. Therefore, besides a user's program files and data files, there. are special files that contain information about directory content or the various input/output devices connected to the system. In Linux, a device is also treated as a file and all the information going to Visual Display Unit is treated as if it were being sent to a file. Linux has the following three categories of files:

• Ordinary files

• Directory files

• Special files

Ordinary Files 

All the files created by a user come under the ordinary category of files. These include all the data files, program files, object files, and executable files. A user can make changes to such files.

Directory Files 

The directory file contains a list of all the files and directories that is present in a directory. A directory file is not modified by a user. Instead, it is modified automatically by the system when a new file or a subdirectory is added to the directory.

Special Files

The majority of Linux's system files are unique files. They can be found in the common Linux directories, such as /dev and /etc, and are often connected to I/O devices. Special files cannot be changed by users.

Linux supports the following types of special files:
  • Character Device files: Files called Character Devices read and write data one character at a time. A character device file is something like a modem. Sequentially accessed devices and character devices are synonyms.
  • Block Device files: Block Device files can access a block of data at a time. Generally, a block of data can be either 512 or 1,024 bytes. Here, the kernel reads or writes a minimum of one block of data at a time. The kernel collects the data in the memory for block memory and then makes it available to a user. Such devices allow random access. This makes I/O operations quick. An example of a block device is the hard disk.
Many of the devices can act as character devices or block devices depending on the command that is used to access the device.
  • Hard links: Special files called hard links enable a single file to have many names. A directory cannot have a hard link file; only a file can. Because they establish a direct link to an inode, these linkages are referred to as hard links. You can only build hard links between files when they are on the same file system since each file system has its own inode information database. A hard link can lead to security problems if it is created on files that are on the partition containing the system files. Users can use this to prevent administrators from fully upgrading a system by pinning possibly vulnerable setuid or setgid files.
The most recent version of the Fedora operating system only allows users to build hard links on files for which they are the owner or have read/write rights to prevent the creation of this type of hard link. In the most recent release of Fedora, this feature is turned on by default.
  • Symbolic links: Symbolic links, also known as soft links, are similar to hard links, except that they can work across different file systems.

    There are two more types of special files .sockets and named pipes .

    Sockets enable inter-process communication and use a network port to connect processes running on different computers. Named pipes transfer data between two processes running on the same computer where the output of one or more processes acts as input to another process. Hence, Named pipes are also referred to as First In First Out (FIFO) files.



Types of users in Linux:

Linux can restrict access to a file depending on the type of user accessing the files. the user's types supported by Linux are :

System administrator
  • File owner
  • Group owner
  • Other users
System administrator:

The system administrator is primarily responsible for the smooth operation of the system. It is the administrator's job to switch on the system console (the computer on which the operating system resides, also known as the server machine). The system administrator also creates users and groups of users for the system and makes backups to prevent loss of data due to system breakdown. In Linux, the system administrator is also known as the root user. The system administrator has all the rights to the Linux system.

File Owner

The user who creates a file is said to be the owner of that file. The owner can perform any operation on that file, such as copying, deleting, and editing.

Group Leader

Take into account a scenario where a project team from Dynasoft Consultants, Inc. consisting of five individuals is working on a software development project for a private detective service. A team analyst is in charge. Programmers make up the other four team members. The group is developing a Linux system. A few programs have been handed to each programmer to create. The data file has been created in the analyst's home directory because the information provided by the detective agency is of a highly private nature. To test software, one programmer might need to link (join) it to another programmer's program. Each programmer in this scenario is the file owner of their individual software files. Each software, however, also belongs to other programmers, allowing them to utilize it to directly access or link to the file. The five users on the project team are referred to as the file's group owner. You can specify which users will be a part of a group in Linux. Just like a user is given a name, a group of users is also given a name.

Other Users

In the example of Dynasoft Consultants, Inc., all the users of the system who are not members of the project group are referred to as other users for the files of that group. Other users are users who do not belong to the particular group. For example, the users belonging to the Finance department could be treated as other users for the Payroll department.

So that’s it for today guys if you want to learn more about Linux OS follow and stay tuned with guerillateck.com

Thanks for learning give us your feed back?

Identifying directory commands of Linux part 4 coming soon

No comments:

Post a Comment