0% found this document useful (0 votes)
13 views

Lesson 05 - File System Organization

The document provides an overview of Ubuntu's file system organization, detailing the hierarchy, important directories, and their functions. It covers key concepts such as mounting and unmounting file systems, configuration files, file permissions, and user administration. Additionally, it includes knowledge checks to reinforce understanding of the material presented.

Uploaded by

Vrushank Bhatt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lesson 05 - File System Organization

The document provides an overview of Ubuntu's file system organization, detailing the hierarchy, important directories, and their functions. It covers key concepts such as mounting and unmounting file systems, configuration files, file permissions, and user administration. Additionally, it includes knowledge checks to reinforce understanding of the material presented.

Uploaded by

Vrushank Bhatt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Ubuntu Fundamentals

File System Organization


Learning Objectives

By the end of this lesson, you will be able to:

Illustrate the file system hierarchy in Ubuntu

Explore the functions of important directories

Mount and unmount file systems

Evaluate configuration files and its uses

Analyze the permissions of files and directories

Add and delete users and groups


File System Organization

File system is the method of organizing and managing your data in files and directories.

• The File system hierarchy begins with the root


directory ‘/’.
• It is also known as the mount point for the
whole system through which your data flows
and occupies space in files.
Important Directories and Their Functions

The various system directories in Ubuntu are:


Important Directories and Their Functions

Some of the important directories are:

bin: Contains all the user commands in binary format


etc: Contains the system configuration files that manage your application’s behavior
sbin: Contains all the commands used by the administrator. These commands are also known as
privilege commands
usr: Contains the kernel header files required for the kernel operations
var: Stores all the logs and email messages
dev: Contains the names of the connected devices. In Linux, devices are treated like files
home: Saves the user’s work. It also saves the user’s profile settings
lib: Saves the pre-compiled apps, frequently used by the OS apps
proc: Contains the current state of the kernel and its settings used in current context
root: It is the home directory for the administrator whose name is root. The administrator is also
known as super user
Mount and Unmount

Mounting refers to the process of attaching the file system to root.

• The file system for all practical purposes can be


considered partitions on the hard disk.
• Unmounting refers to the process of detaching
the file system from the root directory.
Configuration Files in Linux (Ubuntu)

• The behavior of systems and applications is controlled by the configuration file settings.
• The files that contain these settings are known as configuration files.
• Every application or service has the configuration followed by its name.
Configuration Files in Linux (Ubuntu)

Example:
In the given screenshot, you can see the
network card configuration as required by
the network service application.

Network service application’s job is to provide network connectivity based on the


configuration described in the file.
Permissions for Files and Directories

In Linux, there are primarily two types of resources, files and directories, and there
are three stakeholders present. They are user, group, and others.

• The person who created the file is considered


the user or owner.
• People who like to access this file frequently
are called group.
• Remaining set of people forms the others
User Group Others category.
Rights Rights Rights
Permissions for Files and Directories

There are mainly three permissions given in Linux:

• r stands for read, and it allows you to open the file.


• w stands for write and allows you to edit the file. # ls –l file

• x stands for execute, and it allows you to execute -rwxr--r-- 1 root root θ Dec 2 9 2 3 : 4 9 file
the program present in the file or directory.
Other (r - -)

If none of the three permissions are assigned, then Group (r- -)


Owner (rw-)
deny will be the default permission for that file or
directory. File type

• – stands for deny option


Permissions for Files and Directories

Permissions can also be set by octal method. Here, numerical values are used instead of symbols.
r = 4, w = 2, and x = 1
Permissions for Files and Directories

Same permissions can be used for files in directories.

• r indicates that you can go to the directory


and read the files.
• w indicates that you can create files in the
folder.
• x indicates that you can use the ls command
to list the files in the folder.
User Administration

• Users interact with computer systems to accomplish their


tasks by using system resources.
• To accomplish these tasks, users require a user account to log
into the system with the respective credentials.
• Every user who sets up an account has a valid name,
password for authentication, and a user identity number
assigned by the system.
• For more than one person, we have the group identity
number for authorization.
• Home directory is used to store the user’s profile, files, and
other belongings followed by a default shell.
User Administration

Users can be added to the system by two methods: GUI and CLI

• The minimum information required to


perform this task are the name and
password.

• Both GUI or CLI method can be used to


customize any attribute, but the CLI
method is prefered most of the time.
User Administration

• Like addition, deletion of users can also be done using GUI and CLI methods.
• The command # userdel <username> or # userdel -r <username> is used to remove or delete users
from the system.
o -r refers to the home directory.
• Therefore, even the home directory is deleted along with the user details.
User Administration

• Groups are used when the ownership is required for more than one person.
• Like user addition, groups can be added either by the GUI or CLI method.
• There are two types of groups:
o Primary group
o Secondary group
User Administration

Primary group:

• When a user is created by default, then the user is grouped under the primary group.
• The name of this primary group follows the name of the user.
• The command # groupadd <group_name> is used to add a group.

Secondary group:

• If a user wants to join an already present group, then the user is grouped under the secondary group.
• The command # useradd -g <group_name> <username> is used to add a user to a secondary group.
User Administration

Like addition, deletion of groups can be done either by the GUI or CLI method.

The command # groupdel <group_name> is used to delete the group.


Key Takeaways

File system is the method of organizing and managing your data


in files and directories.

sbin directory contains all the commands used by the administrator.


They are also known as privilege commands.

The behavior of systems and applications is controlled by the


configuration files settings.

Files and directories are the two types of resources in Ubuntu.


Knowledge Check
Knowledge
Check
Who are the three stakeholders in Linux?
1

A. Administrator, standard user, others

B. User, standard user, others

C. User, group, others

D. Administrator, group, others


Knowledge
Check
Who are the three stakeholders in Linux?
1

A. Administrator, standard user, others

B. User, standard user, others

C. User, group, others

D. Administrator, group, others

The correct answer is C

The three stakeholders in Linux are user, group, and others.


Knowledge
Check
Which is the most used filesystem in the Linux distributions?
2

A. ext4

B. FAT32

C. NTFS

D. POSIX
Knowledge
Check
Which is the most used filesystem in the Linux distributions?
2

A. ext4

B. FAT32

C. NTFS

D. POSIX

The correct answer is A

ext4 is the most used file system in Linux distributions. Others are used by non-Linux OS.
Knowledge
Check
Which directory saves the current kernel parameters?
3

A. sbin

B. bin

C. var

D. proc
Knowledge
Check
Which directory saves the current kernel parameters?
3

A. sbin

B. bin

C. var

D. proc

The correct answer is D

proc directory saves the current kernel parameters.


Knowledge
Check
Which directory stores the user commands?
4

A. sbin

B. bin

C. var

D. proc
Knowledge
Check
Which directory stores the user commands?
4

A. sbin

B. bin

C. var

D. proc

The correct answer is B

bin directory saves all the user commands.

You might also like