Let's talk Linux 102 - Linux File System and Permission

ยท

3 min read

This article is a continuation of my previous article on Linux.

If you are looking to get your feet wet with Linux, make sure to check out my previous article - Let's talk Linux 101 - Kernel, Terminal, Desktop

The Linux File System

Files are used to store data on a Linux system. These files are organized into directories or folders. Files and directories make up the file system.

Most Linux Distributions or distros follow the Filesystem Hierarchy Standard (FHS) - which describes how the file system is organized.

The standard makes it possible to switch between distributions easily and to use unfamiliar distros without having to spend a lot of time looking in different places for files we need.

Structure of the Linux file system

In the Linux file system, everything starts with the file system root and it is the top level of the file system represented by a slash /

On the Linux system, there is only one filesystem root. Even if we plug on other storage devices, those become part of the overall filesystem.

The following table provides a very brief list of the top-level Linux directories and their purposes

DirectoryDescription
/homethe user's personal files are stored here
/bincontains user executable files
/sbincontains system binary files
/usrshort for "Unix System Resources". Contains programs, libraries, documentation
/mnt and /mediaused for mounting or attaching other filesystems
/etcsystem-wide configuration files are stored here
/varvariable system information is kept here
/dev, /proc, and /syscreated by the kernel to represent hardware available on the system.

User and System Security

On Linux systems, there is a super user or an admin account called root. This account has the ability or privileges to access any file in the system and to change settings on a system-wide base.

There is also another user called the standard user. This user can not access the files that belong to other users unless specially granted permission to do so.

We can use the root account directly or we can borrow its privileges using the su or sudo command, which can be used to run a particular command using superuser privileges.

For safety and security reasons, we would rarely if ever, actively use the computer under the root account. Not only is it a bad idea, but it can also cause problems that can be tricky to resolve.

Permissions

The key difference between users is what is called permissions, which is a way to represent which user has which right to do which things to which files.

Permissions let us indicate whether a user, member of a particular group, or anyone at all can read from a given file, write data to it, or even execute it.

Permissions are often represented either as numbers or letters and in each case, they are made up of three sections:

  1. User

  2. Group

  3. Others

To make changes at the command line, we will use any of these commands: chmod, chown, chgrp.

Conclusion

The Linux file system and permissions are essential aspects of the Linux operating system and understanding the file system and permissions on a Linux system is a fundamental aspect of working with Linux.

Thanking you so much for reading...

Do well to like ๐Ÿ‘, share and subscribe ๐Ÿ˜‰ for more.

...stay tuned for more on Linux.

ย