Fedora OS Installation and Shell Scripting: Practical Assignment
VerifiedAdded on 2022/10/18
|34
|3511
|285
Practical Assignment
AI Summary
This assignment provides a comprehensive guide to installing the Fedora Linux operating system within the Oracle VM VirtualBox environment. The report meticulously details the installation process, from downloading the ISO image and creating a virtual machine to configuring settings and installing guest additions. The assignment also delves into shell scripting, including the creation of scripts to profile the system and manage files. The document includes detailed steps, screenshots, and explanations, providing a practical understanding of Linux system administration. The student demonstrates the use of shell scripting to automate tasks and manage system information, which is a crucial skill for any aspiring Linux user or system administrator. Finally, the assignment includes an overview of the operating system, the virtual machine, and the hardware requirements needed for the installation, making it a valuable resource for students learning about operating systems and virtualization.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.

Running Head: INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Name of the Student:
Name of the University:
Author Note:
INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Name of the Student:
Name of the University:
Author Note:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

1INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Table of Contents
Introduction......................................................................................................................................2
Discussion........................................................................................................................................2
The Fedora OS.............................................................................................................................2
Virtual Machine...........................................................................................................................3
Hardware requirements....................................................................................................................3
Oracle VM VirtualBox................................................................................................................3
Fedora Linux................................................................................................................................4
Installation of the Fedora Linux in VirtualBox...............................................................................4
Installing the guest additions.........................................................................................................18
SHELL SCRIPTING.....................................................................................................................19
Introduction....................................................................................................................................19
Discussion......................................................................................................................................20
Writing the shell script...............................................................................................................20
Executing the shell script...........................................................................................................20
Script 1: Profile of the System...................................................................................................21
Script 2: File management.........................................................................................................26
Script 3: Sorting the data stored in a file...................................................................................29
Conclusion.....................................................................................................................................32
References......................................................................................................................................33
Table of Contents
Introduction......................................................................................................................................2
Discussion........................................................................................................................................2
The Fedora OS.............................................................................................................................2
Virtual Machine...........................................................................................................................3
Hardware requirements....................................................................................................................3
Oracle VM VirtualBox................................................................................................................3
Fedora Linux................................................................................................................................4
Installation of the Fedora Linux in VirtualBox...............................................................................4
Installing the guest additions.........................................................................................................18
SHELL SCRIPTING.....................................................................................................................19
Introduction....................................................................................................................................19
Discussion......................................................................................................................................20
Writing the shell script...............................................................................................................20
Executing the shell script...........................................................................................................20
Script 1: Profile of the System...................................................................................................21
Script 2: File management.........................................................................................................26
Script 3: Sorting the data stored in a file...................................................................................29
Conclusion.....................................................................................................................................32
References......................................................................................................................................33

2INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Introduction
The operating system or the OS is basically a program which acts as a medium of
interaction between the computer hardware and software. Operating systems also manages the
overall resources of a computer and the basic operations. The operating system can also control
and monitor the execution of applications that are installed in the computer, this includes the
application programs and the system software. The OS consists of many parts and features. The
three most important and identifiable components of the OS are: Kernel, the User Interface and
the Interface of the Application programming. Fedora OS also known as the Fedora Linux is a
very popular Linux distribution. In this report, a discussion of how to install the very popular
Fedora Linux in the Oracle VM Virtual box is explained. The steps are included in this report. A
brief history of the Fedora Linux is also included in this report. The use of virtual machines in
order to run an operating system on top of currently running OS is also explained.
Discussion
The Fedora OS
The Fedora Linux is a Linux based OS which was created in 2003 by the community
distribution popularly known as Fedora Project. This distribution of the Linux was sponsored by
the Red Hat. The Fedora Linux includes software that are free and open source which aims to
provide better efficiency. There are many versions of the Fedora OS but, in this report the
installation of the Fedora Workstation is explained in details in the Virtual Box. The Fedora
workstation is best for normal use. This version provides all open source tools and utility
software that can be used by anyone from students to corporate professional. The user friendly
Introduction
The operating system or the OS is basically a program which acts as a medium of
interaction between the computer hardware and software. Operating systems also manages the
overall resources of a computer and the basic operations. The operating system can also control
and monitor the execution of applications that are installed in the computer, this includes the
application programs and the system software. The OS consists of many parts and features. The
three most important and identifiable components of the OS are: Kernel, the User Interface and
the Interface of the Application programming. Fedora OS also known as the Fedora Linux is a
very popular Linux distribution. In this report, a discussion of how to install the very popular
Fedora Linux in the Oracle VM Virtual box is explained. The steps are included in this report. A
brief history of the Fedora Linux is also included in this report. The use of virtual machines in
order to run an operating system on top of currently running OS is also explained.
Discussion
The Fedora OS
The Fedora Linux is a Linux based OS which was created in 2003 by the community
distribution popularly known as Fedora Project. This distribution of the Linux was sponsored by
the Red Hat. The Fedora Linux includes software that are free and open source which aims to
provide better efficiency. There are many versions of the Fedora OS but, in this report the
installation of the Fedora Workstation is explained in details in the Virtual Box. The Fedora
workstation is best for normal use. This version provides all open source tools and utility
software that can be used by anyone from students to corporate professional. The user friendly

3INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
design of the user interface is very reliable and powerful. The desktop is based on the GNOME 3
shell and uses the vanilla GNOME as the default desktop. The OS is capable of running virtual
machines with the help of GNOME Boxes. The latest version of Fedora Workstation 30 is used
in this report.
Virtual Machine
The Virtual Machine abbreviated as VM in the world of computing is the term or
software that is used to emulate a computer system. A virtual machine provides complete
functionality of an operating system and is based on the computer architecture. The
implementation of virtual machines may require specialized hardware and software, and
sometime both. There exists mainly two different forms of virtual machines: one is known as
system virtual machine and another is known as process virtual machine. The system virtual
machines are also known as full virtualization VMs offers the functionality of a real machine. To
execute a computer program in a platform independent environment, process virtual machines
are mainly used.
A virtual machine performs like an independent computer system with the virtual
hardware devices. In an OS the VM works as a process. The live CD image is used to boot into
the operating system. In the world of VM, operating systems running in the virtual machine is
known to be the guest and the original operating system is known to be the host.
Hardware requirements
Oracle VM VirtualBox
In this report the use of Oracle VM VirtualBox version 6.0.10 r132072 (Qt5.6.2) is used.
There are many other options available like the VMware Player, VMware Fusion and Parallels
design of the user interface is very reliable and powerful. The desktop is based on the GNOME 3
shell and uses the vanilla GNOME as the default desktop. The OS is capable of running virtual
machines with the help of GNOME Boxes. The latest version of Fedora Workstation 30 is used
in this report.
Virtual Machine
The Virtual Machine abbreviated as VM in the world of computing is the term or
software that is used to emulate a computer system. A virtual machine provides complete
functionality of an operating system and is based on the computer architecture. The
implementation of virtual machines may require specialized hardware and software, and
sometime both. There exists mainly two different forms of virtual machines: one is known as
system virtual machine and another is known as process virtual machine. The system virtual
machines are also known as full virtualization VMs offers the functionality of a real machine. To
execute a computer program in a platform independent environment, process virtual machines
are mainly used.
A virtual machine performs like an independent computer system with the virtual
hardware devices. In an OS the VM works as a process. The live CD image is used to boot into
the operating system. In the world of VM, operating systems running in the virtual machine is
known to be the guest and the original operating system is known to be the host.
Hardware requirements
Oracle VM VirtualBox
In this report the use of Oracle VM VirtualBox version 6.0.10 r132072 (Qt5.6.2) is used.
There are many other options available like the VMware Player, VMware Fusion and Parallels
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

4INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Desktop but, these programs are not as popular as the VirtualBox. One of the main reasons of the
popularity of the VirtualBox is that it is completely open source and free and supports every OS
like the Windows, Linux and the Mac OS X.
In order to run a Virtual machine any recent intel or AMD processors would be enough.
The hardware requirements to run the OS in the Virtual machine depends on the hardware
required by the operating system or the guest OS. The allocation of hard disk space and RAM is
customizable by the user.
Fedora Linux
The list of hardware requirements for the Fedora workstation 30 is provided below:
1 GHz of Processor (It is recommended to use 2 GHz Dual core processor).
Minimum 2 GB of RAM.
15 GB of space on the hard disk.
Bootable Media (A USB or DVD)
Internet connection is required but is not mandatory.
Installation of the Fedora Linux in VirtualBox
Step 1: The first step is to down the ISO live image of the Fedora Workstation 30 from the
official website. After that save the file to a location within a folder and name the folder as
“Fedora OS” or any preferred name. Before downloading the live image from the official
website of fedora project check and determine the system architecture.
Step 2: Open the VM VirtualBox and select the New option.
Desktop but, these programs are not as popular as the VirtualBox. One of the main reasons of the
popularity of the VirtualBox is that it is completely open source and free and supports every OS
like the Windows, Linux and the Mac OS X.
In order to run a Virtual machine any recent intel or AMD processors would be enough.
The hardware requirements to run the OS in the Virtual machine depends on the hardware
required by the operating system or the guest OS. The allocation of hard disk space and RAM is
customizable by the user.
Fedora Linux
The list of hardware requirements for the Fedora workstation 30 is provided below:
1 GHz of Processor (It is recommended to use 2 GHz Dual core processor).
Minimum 2 GB of RAM.
15 GB of space on the hard disk.
Bootable Media (A USB or DVD)
Internet connection is required but is not mandatory.
Installation of the Fedora Linux in VirtualBox
Step 1: The first step is to down the ISO live image of the Fedora Workstation 30 from the
official website. After that save the file to a location within a folder and name the folder as
“Fedora OS” or any preferred name. Before downloading the live image from the official
website of fedora project check and determine the system architecture.
Step 2: Open the VM VirtualBox and select the New option.

5INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Step 3: Creating the virtual machine. The Name field indicates the name of the OS, which is
provided by the user. After that the type of OS and the version is selected. After that click the
next button.
Step 4: Next is the providing the RAM size for the virtual machine. It can be left default with the
size 1024 MB but, it can be changed for better performance. Then select next.
Step 3: Creating the virtual machine. The Name field indicates the name of the OS, which is
provided by the user. After that the type of OS and the version is selected. After that click the
next button.
Step 4: Next is the providing the RAM size for the virtual machine. It can be left default with the
size 1024 MB but, it can be changed for better performance. Then select next.

6INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Step 5: In the next step a virtual hard disk is created. Select the option “create a virtual hard disk
now” then select button “Create”.
In the next window the type for the hard disk should remain as VDI, which is VirtualBox Disk
Image.
Step 5: In the next step a virtual hard disk is created. Select the option “create a virtual hard disk
now” then select button “Create”.
In the next window the type for the hard disk should remain as VDI, which is VirtualBox Disk
Image.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
In the next window, the option “dynamically allocated” should be selected and after that click
next.
Step 6: The location of the file and the size for the virtual hard disk is allocated. The default size
is 8 GB but, it can be changed according to the user. Although it is recommended not to allocate
much memory for the virtual hard disk.
In the next window, the option “dynamically allocated” should be selected and after that click
next.
Step 6: The location of the file and the size for the virtual hard disk is allocated. The default size
is 8 GB but, it can be changed according to the user. Although it is recommended not to allocate
much memory for the virtual hard disk.

8INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Step 7: After the creation of the virtual hard disk and RAM it shows this window:
Step 8: The final step would be to load the iso file of the Fedora workstation and then install it.
Before doing that there are some settings that needs to be altered. Firstly, select the “Settings”
button after selecting the OS. The image above shows the settings button.
Step 7: After the creation of the virtual hard disk and RAM it shows this window:
Step 8: The final step would be to load the iso file of the Fedora workstation and then install it.
Before doing that there are some settings that needs to be altered. Firstly, select the “Settings”
button after selecting the OS. The image above shows the settings button.

9INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
In the next window within the “General” option select Advanced after that change the “Shared
Clipboard” plus “Drag n’ Drop” to bidirectional.
Step 9: After that go to the System option and within the Processor tab select the number of
CPUs that will be assigned to the virtual machine. In the Motherboard tab select the Network
option also.
In the next window within the “General” option select Advanced after that change the “Shared
Clipboard” plus “Drag n’ Drop” to bidirectional.
Step 9: After that go to the System option and within the Processor tab select the number of
CPUs that will be assigned to the virtual machine. In the Motherboard tab select the Network
option also.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

10INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Step 10: Now in the next step, double click on the Fedora OS option which reads as “power off”.
This will launch the virtual machine and ask for the start-up disk. Browse to the location of the
disk image or the .iso file and select that.
Step 10: Now in the next step, double click on the Fedora OS option which reads as “power off”.
This will launch the virtual machine and ask for the start-up disk. Browse to the location of the
disk image or the .iso file and select that.

11INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
After selecting the disk image click the start button.
This will start the virtual box and load the OS. In the next screen select the option “Start Fedora-
Workstation-Live 30”
After selecting the disk image click the start button.
This will start the virtual box and load the OS. In the next screen select the option “Start Fedora-
Workstation-Live 30”

12INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
After selecting the option it will start the boot and the boot window will like the provided screen
below:
Step 11: After the boot is done, the OS should be installed in the virtually created hard disk
space.
Select the Install to Hard Drive option.
After selecting the option it will start the boot and the boot window will like the provided screen
below:
Step 11: After the boot is done, the OS should be installed in the virtually created hard disk
space.
Select the Install to Hard Drive option.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

13INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
In the next window, preferred language of the user is selected.
In the following window, the destination of the installation is chosen.
Select the disk then click the “Done” button.
In the next window, preferred language of the user is selected.
In the following window, the destination of the installation is chosen.
Select the disk then click the “Done” button.

14INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Next the time zone is selected according to the user.
After selecting the time zone, click the “Begin” Install button.
Next the time zone is selected according to the user.
After selecting the time zone, click the “Begin” Install button.

15INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
After that the installation process will start, this process might take some time.
After that the installation process will start, this process might take some time.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

16INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
After the installation is complete, click the Quit button and Reboot the Virtual machine.
Restart the Virtual Machine.
After the installation is complete, click the Quit button and Reboot the Virtual machine.
Restart the Virtual Machine.

17INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
After restarting the Virtual Machine, installation process is complete.
This is the terminal window after the installation is complete.
After restarting the Virtual Machine, installation process is complete.
This is the terminal window after the installation is complete.

18INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Installing the guest additions
Step 1: In the main screen of the VM VirtualBox select the Fedora Linus OS. After that, go to
the Settings and within that select the option “Storage”.
Step 2: In the Controller: IDE remove the current .iso file add the “VBoxGuestAdditions.iso”
The guest additions ISO can be found in the Oracle folder in C:\Program Files\Oracle\
VirtualBox
Step 3: After that start the virtual machine and set the username and password to use the OS.
After the installation is complete open the terminal and write the command ‘date’ and ‘cal’ to
check the time and calendar and be sure that the OS is working.
Installing the guest additions
Step 1: In the main screen of the VM VirtualBox select the Fedora Linus OS. After that, go to
the Settings and within that select the option “Storage”.
Step 2: In the Controller: IDE remove the current .iso file add the “VBoxGuestAdditions.iso”
The guest additions ISO can be found in the Oracle folder in C:\Program Files\Oracle\
VirtualBox
Step 3: After that start the virtual machine and set the username and password to use the OS.
After the installation is complete open the terminal and write the command ‘date’ and ‘cal’ to
check the time and calendar and be sure that the OS is working.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

19INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
SHELL SCRIPTING
Introduction
Bash is the name provided to the shell that is found in Linux and Unix Operating
systems. Bourne Again Shell is the full form for the bash (Tushar, 2013). Bash is the command
like interface (CLI) that enables a user to interact with the Linux operating system. The
commands that are used in the CLI is used in the shell script also in order to execute every
command sequentially but all at the same time so, the bash scrip is used to execute a series of
command in the terminal (Guan, 2016). The origin of Bash Shell is marked by introduction of
the shell in the Unix environment, which was written by Steve Bourne. In the previous report,
the installation guide for Fedora Linux in the Virtual Box is provided and in this report, shell
scripting will be discussed. Three shell scripts are provided in this report which perform different
functions. A brief description of how to write and execute the shell script in the shell is also
SHELL SCRIPTING
Introduction
Bash is the name provided to the shell that is found in Linux and Unix Operating
systems. Bourne Again Shell is the full form for the bash (Tushar, 2013). Bash is the command
like interface (CLI) that enables a user to interact with the Linux operating system. The
commands that are used in the CLI is used in the shell script also in order to execute every
command sequentially but all at the same time so, the bash scrip is used to execute a series of
command in the terminal (Guan, 2016). The origin of Bash Shell is marked by introduction of
the shell in the Unix environment, which was written by Steve Bourne. In the previous report,
the installation guide for Fedora Linux in the Virtual Box is provided and in this report, shell
scripting will be discussed. Three shell scripts are provided in this report which perform different
functions. A brief description of how to write and execute the shell script in the shell is also

20INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
provided in this report. In order to write the shell script vim or nano editors in the Fedora OS will
be used (Sobell, 2013).
Discussion
Writing the shell script
The very first step is to determine the location of the bash directory. This is achieved by
using the command ‘which bash’ in the command line interface (Love, 2013). For this case the
path of the bash is “/usr/bin/bash”. The bash location is important because it marks the starting
point for any shell script. The bash directory contains the interpreter for the bash script. The
Shebang “#!’ is used in order to direct the shell script to the location of the interpreter (Mary,
2015).
Any text editor can be used to write the script but in this case only nano or vim editor will
be used. Some popular text editors are gedit and vi. The location of the bash should be included
at the beginning of the shell script. After that the commands are written in order of the execution.
The file after writing the script should be saved with the extension ‘.sh’.
Executing the shell script
To execute the script the command ‘chmod’ is used (Goddard, 2016). The general
command for the execution is ‘chmod [reference] [operator] [mode]’. chmod command indicates
“change mode”. This is a system level command. The command is used to change the permission
of a file by the user manually. To make the shell script executable the command ‘chmod +x
<filename>’ is used. The next step is to run the script. This is attend by using the command
‘./<filename>.
SHELL SCRIPTS
provided in this report. In order to write the shell script vim or nano editors in the Fedora OS will
be used (Sobell, 2013).
Discussion
Writing the shell script
The very first step is to determine the location of the bash directory. This is achieved by
using the command ‘which bash’ in the command line interface (Love, 2013). For this case the
path of the bash is “/usr/bin/bash”. The bash location is important because it marks the starting
point for any shell script. The bash directory contains the interpreter for the bash script. The
Shebang “#!’ is used in order to direct the shell script to the location of the interpreter (Mary,
2015).
Any text editor can be used to write the script but in this case only nano or vim editor will
be used. Some popular text editors are gedit and vi. The location of the bash should be included
at the beginning of the shell script. After that the commands are written in order of the execution.
The file after writing the script should be saved with the extension ‘.sh’.
Executing the shell script
To execute the script the command ‘chmod’ is used (Goddard, 2016). The general
command for the execution is ‘chmod [reference] [operator] [mode]’. chmod command indicates
“change mode”. This is a system level command. The command is used to change the permission
of a file by the user manually. To make the shell script executable the command ‘chmod +x
<filename>’ is used. The next step is to run the script. This is attend by using the command
‘./<filename>.
SHELL SCRIPTS

21INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Script 1: Profile of the System
The name of the script is “Goud_11662529.sh”.
To write this script the vim editor is used. Before that the vim editor should be installed using the
command ‘sudo yum install vim’. Vim editor is the improved version of Vi editor.
After writing the script press esc key. Then ‘:wq’ in order to save the file.
Script 1: Profile of the System
The name of the script is “Goud_11662529.sh”.
To write this script the vim editor is used. Before that the vim editor should be installed using the
command ‘sudo yum install vim’. Vim editor is the improved version of Vi editor.
After writing the script press esc key. Then ‘:wq’ in order to save the file.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

22INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
The next step is to run the script. To run the script in the terminal it should be made executable
first. To do that, type the command “chmod +x Goud_11662529.sh” in the bash. After that if it
returns to the hostname prompting the user to enter another command then the script is made
executable.
The next step is to run the script. To run the script in the terminal it should be made executable
first. To do that, type the command “chmod +x Goud_11662529.sh” in the bash. After that if it
returns to the hostname prompting the user to enter another command then the script is made
executable.

23INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
Now the command “./Goud_11662529.sh” is used to run the script.
Note: There are some command that need root access. So, while the script is executed there
might be a prompt to provide the password for the user. After entering the password the rest of
the commands are executed but, to avoid this run the script using root access. This will prevent
the issue.
Output of the script:
Now the command “./Goud_11662529.sh” is used to run the script.
Note: There are some command that need root access. So, while the script is executed there
might be a prompt to provide the password for the user. After entering the password the rest of
the commands are executed but, to avoid this run the script using root access. This will prevent
the issue.
Output of the script:

24INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
The shell script Goud_11662529.sh
#!/usr/bin/bash
echo “******This script displays the information about the system*****”
The shell script Goud_11662529.sh
#!/usr/bin/bash
echo “******This script displays the information about the system*****”
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

25INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
echo “-----Information about the Operating System-----“
lsb_release –a
echo “-----Information about the hosts-----“
hostname
echo “-----Network interfaces and Routing information-----“
nmcli device status
netstat –r
echo “-----List of currently logged in users and then the list of users who recently logged in-----“
who
w
echo “-----Information about used and free memory-----“
free –m
echo “-----Display if the Linux OS is on physical or virtual machine-----“
echo “-----Information about the Operating System-----“
lsb_release –a
echo “-----Information about the hosts-----“
hostname
echo “-----Network interfaces and Routing information-----“
nmcli device status
netstat –r
echo “-----List of currently logged in users and then the list of users who recently logged in-----“
who
w
echo “-----Information about used and free memory-----“
free –m
echo “-----Display if the Linux OS is on physical or virtual machine-----“

26INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
sudo dmidecode | grep Product
echo “*****End******”
Script 2: File management
The script requires the user to make a directory and copy a file to that directory.
Firstly, open the vim editor and write the script.
The name for the script is “make_directory.sh”
In the execution window it can be seen that after the hostname “localhost” there is abc which
indicates that the current working directory is within a folder named as “abc”.
Within this folder, another folder with the name “Goud_11662529” will be created if it does not
exist and after that the operation of coping a file is done. Before the execution of the bash script a
file named as “abc.txt” is created within the “abc” folder with some text within it.
sudo dmidecode | grep Product
echo “*****End******”
Script 2: File management
The script requires the user to make a directory and copy a file to that directory.
Firstly, open the vim editor and write the script.
The name for the script is “make_directory.sh”
In the execution window it can be seen that after the hostname “localhost” there is abc which
indicates that the current working directory is within a folder named as “abc”.
Within this folder, another folder with the name “Goud_11662529” will be created if it does not
exist and after that the operation of coping a file is done. Before the execution of the bash script a
file named as “abc.txt” is created within the “abc” folder with some text within it.

27INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
During this process also the user will be prompted to provide the password, so it is better to run
the script as su.
The script make_directory.sh
#!/bin/bash
echo "*****This script creates a directory and copies a file to the directory if the file has write
permission*****"
echo "-----Creating the directory named as Goud_11662529-----"
mkdir Goud_11662529
echo "-----Ask the user if he/she wants to copy a file to the directory----"
During this process also the user will be prompted to provide the password, so it is better to run
the script as su.
The script make_directory.sh
#!/bin/bash
echo "*****This script creates a directory and copies a file to the directory if the file has write
permission*****"
echo "-----Creating the directory named as Goud_11662529-----"
mkdir Goud_11662529
echo "-----Ask the user if he/she wants to copy a file to the directory----"
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

28INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
echo "Enter a filename to check the file permission and copy it to the folder:"
read filename
##Checking the write permission
[ -w $filename ] && W="Write = yes" || W="Write = No"
##Checking the read permission
[ -r $filename ] && R="Read = yes" || R="Read = No"
##Checking the execute permission
[ -x $filename ] && X="Execute = yes" || X="Execute = No"
echo "Permissions for the file $filename are:"
echo "$W"
echo "$R"
echo "$X"
if [ "W = yes" ];
echo "Enter a filename to check the file permission and copy it to the folder:"
read filename
##Checking the write permission
[ -w $filename ] && W="Write = yes" || W="Write = No"
##Checking the read permission
[ -r $filename ] && R="Read = yes" || R="Read = No"
##Checking the execute permission
[ -x $filename ] && X="Execute = yes" || X="Execute = No"
echo "Permissions for the file $filename are:"
echo "$W"
echo "$R"
echo "$X"
if [ "W = yes" ];

29INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
then
sudo cp -T $filename /Goud_11662529
echo "File coppied successfully!!"
else
echo "No result program end!"
fi
Script 3: Sorting the data stored in a file
The script has two functions one is to extract data from a file and storing that into another file
and then sort the new data.
For this script two files were made named as “Goud_11662529_hotel.txt” and another
“Goud_11662529_Hotls.txt” respectively.
The first file, which is “Goud_11662529_hotel.txt” contains a list of 100 lines text which are
supposed to be 100 hotel names. The other file “Goud_11662529_Hotls.txt” is created and is
empty as the output will be stored in that file. Both the files were created using the vim editor.
The script is named as “sort.sh”. The script is written using the vim editor.
then
sudo cp -T $filename /Goud_11662529
echo "File coppied successfully!!"
else
echo "No result program end!"
fi
Script 3: Sorting the data stored in a file
The script has two functions one is to extract data from a file and storing that into another file
and then sort the new data.
For this script two files were made named as “Goud_11662529_hotel.txt” and another
“Goud_11662529_Hotls.txt” respectively.
The first file, which is “Goud_11662529_hotel.txt” contains a list of 100 lines text which are
supposed to be 100 hotel names. The other file “Goud_11662529_Hotls.txt” is created and is
empty as the output will be stored in that file. Both the files were created using the vim editor.
The script is named as “sort.sh”. The script is written using the vim editor.

30INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
After writing the shell script the script is made executable using the chmod command.
After running the script the output is obtained in the command line interface.
After writing the shell script the script is made executable using the chmod command.
After running the script the output is obtained in the command line interface.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

31INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
The script sort.sh
#!/usr/bin/bash
echo "*****This is the script to get lines 20 to 30 from a 100 line txt file and store that in a new
file and sort the new data*****"
echo "-----Getting the lines from 20 to 30 from the file and storing them in a new file-----"
tail -n +20 Goud_11662529_hotel.txt | head -n 10 > Goud_11662529_Hotls.txt
cat Goud_11662529_Hotls.txt
echo "-----Sorting the data-----"
sort Goud_11662529_Hotls.txt
The script sort.sh
#!/usr/bin/bash
echo "*****This is the script to get lines 20 to 30 from a 100 line txt file and store that in a new
file and sort the new data*****"
echo "-----Getting the lines from 20 to 30 from the file and storing them in a new file-----"
tail -n +20 Goud_11662529_hotel.txt | head -n 10 > Goud_11662529_Hotls.txt
cat Goud_11662529_Hotls.txt
echo "-----Sorting the data-----"
sort Goud_11662529_Hotls.txt

32INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
echo "*****End*****"
Conclusion
The Fedora Linux OS provides with a simple user interface that can be used by anyone.
The OS has many open source applications that can be used for higher efficiency. In the next
report, the discussion on shell scripting is provided. In addition, the commands used in the scripts
provided in this report uses very easy and accurate commands. All the scripts are tested properly
and the outcomes were captured and provided for better understanding of the output from
running the scripts. In conclusion, In conclusion, the Fedora Linux is installed successfully in the
Oracle VM VirtualBox and using that the execution of all the shell scripts were done accurately.
echo "*****End*****"
Conclusion
The Fedora Linux OS provides with a simple user interface that can be used by anyone.
The OS has many open source applications that can be used for higher efficiency. In the next
report, the discussion on shell scripting is provided. In addition, the commands used in the scripts
provided in this report uses very easy and accurate commands. All the scripts are tested properly
and the outcomes were captured and provided for better understanding of the output from
running the scripts. In conclusion, In conclusion, the Fedora Linux is installed successfully in the
Oracle VM VirtualBox and using that the execution of all the shell scripts were done accurately.

33INSTALLING FEDORA OS IN THE ORACLE VM VIRTUAL BOX
References
Love, R., 2013. Linux system programming: talking directly to the kernel and C library. "
O'Reilly Media, Inc.".
Mary, C., 2015. Shellshock attack on linux systems–bash. International Research Journal of
Engineering and Technology, 2(8), pp.1322-1325.
Goddard, D.M., Oracle International Corp, 2016. Intelligent heuristics for file systems and file
system operations. U.S. Patent 9,298,915.
Sobell, M.G., 2013. A practical guide to Linux commands, editors, and shell programming.
Prentice Hall.
Tushar, S., 2013. Linux shell scripting cookbook. Packt Publishing Ltd.
Guan, X., 2016. Shell Scripting.
References
Love, R., 2013. Linux system programming: talking directly to the kernel and C library. "
O'Reilly Media, Inc.".
Mary, C., 2015. Shellshock attack on linux systems–bash. International Research Journal of
Engineering and Technology, 2(8), pp.1322-1325.
Goddard, D.M., Oracle International Corp, 2016. Intelligent heuristics for file systems and file
system operations. U.S. Patent 9,298,915.
Sobell, M.G., 2013. A practical guide to Linux commands, editors, and shell programming.
Prentice Hall.
Tushar, S., 2013. Linux shell scripting cookbook. Packt Publishing Ltd.
Guan, X., 2016. Shell Scripting.
1 out of 34
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.