0% found this document useful (0 votes)
16 views4 pages

Craw Security RHCSA (SA1) - Class - 04

The document outlines the Linux file system hierarchy, emphasizing that all files are organized in a single inverted tree structure with the root directory (/) at the top. It details important directories in Red Hat Enterprise Linux, such as /usr for installed software, /etc for configuration files, and /var for variable data, along with commands to navigate and manage these directories. Additionally, it explains the concepts of absolute and relative paths for locating files within the file system.

Uploaded by

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

Craw Security RHCSA (SA1) - Class - 04

The document outlines the Linux file system hierarchy, emphasizing that all files are organized in a single inverted tree structure with the root directory (/) at the top. It details important directories in Red Hat Enterprise Linux, such as /usr for installed software, /etc for configuration files, and /var for variable data, along with commands to navigate and manage these directories. Additionally, it explains the concepts of absolute and relative paths for locating files within the file system.

Uploaded by

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

## CHAPTER 3 - MANAGING FILES FROM THE COMMAND LINE ##

TOPIC-01: Describing Linux File System Hierarchy Concept

Linux File System Hierarchy Concepts

On a Linux operating system, all files are stored on file systems that are
structured into a single inverted tree of directories, referred to as the file-
system hierarchy.

This hierarchy is considered inverted because the root of the tree is


located at the top, while its branches—containing directories and
subdirectories—extend below the root.

The / directory serves as the root directory, positioned at the top of the
file-system hierarchy. Additionally, the / character functions as a directory
separator in file paths (e.g., /dev/sr0).

TOPIC-02: Important Red Hat Enterprise Linux Directories

Red Hat Enterprise Linux Directories

The /usr Installed software, shared libraries, include files, and read-only
program data.

The subdirectories include:

/usr/bin - User commands.

/usr/sbjn - System administration commands.

/usr/local - Locally customized software.

To check the location of ls command we can use which command.

[root@server1 ~] # which ls

Output: /usr/bin/ls

So, it can also be run like:

[root@server1 ~] # /usr/bin/ls (which is same as running only ls on


prompt)

[root@server1 ~] # /usr/sbin/useradd linda

[root@server1 ~] # /usr/bin/cat /etc/passwd I qrep linda

To check all available path from where commands can run, we can use:

[root@server1 ~] # echo $PATH


/home/student/.local/bin:/home/student/bin:/usr/local/bin:/usr/bin:/usr/local/
sbin:/usr/sbin

/etc - All configuration files

(/var) - Variable data specific to this system that should persist between
boots. Files that dynamically change, such as databases, cache
directories, log files, printer-spooled documents, and website content may
be found under

/var.

The (/run) directory contains runtime data for processes that have started
since the last system boot. This data includes process ID files, lock files,
and other temporary information. The contents of this directory are
recreated at each reboot.

We can check all device mounted during run time using below command:

[root@server1 ~] # df -hT

The option (h) for Human Readable and (T) for filesystem.

"The /home directory contains the home directories of regular users,


where they can store their personal data and configuration files. The
superuser's home directory is located at /root.

The (/tmp) is a world-writable directory used to store temporary files. Files


in this directory are automatically deleted if they have not been accessed,
modified, or changed for 10 days. Additionally, there is another temporary
directory, (/var/tmp), where files are automatically deleted if they have
not been accessed, modified, or changed for more than 30 days.

All the standard users can be listed using below command

[root@server1 ~]# ls -l /home/

>> User profiles (including Desktop, Downloads, Documents, etc.) are not
created until the user has logged into the system at least once.

>> Home directory of root/super user is (/root).

The /boot directory contains the files required to initiate/start the


system's boot process.
The /dev directory contains special device files that the system uses to
interact with hardware components.
TOPIC-03: Absolute and Relative Paths and navigating the path

Absolute and Relative Paths Concepts

Absolute Paths:

The path of a file or directory specifies its unique location within the file
system. It is a fully qualified name that denotes the exact position of the
file in the file-system hierarchy.

Starting from the root (/) directory, it includes each subdirectory that must
be traversed to reach the desired file.

A path name beginning with a forward slash (/) is considered an absolute


path name.

Relative Paths:

The working directory, also called the current working directory, refers to
the user's current location within the file system.

A relative path identifies a file or directory by specifying only the path


required to reach it from the working directory.

If a path name begins with any character other than a forward slash (/), it
is considered a relative path name.

You might also like