(F2-Formative) - Linux Installation, Environment Familiarization and File Creation Commands

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

COMPUTER ENGINEERING DEPARTMENT

CPE0047L/CPE0047LL/CPEOPSYSLA
(OPERATING SYSTEM - LAB)

EXERCISE

2
LINUX INSTALLATION/ENVIRONMENT FAMILIARIZATION AND FILE
CREATION COMMANDS

Student Name / Group


Name:
Name Role
Members (if Group):

Section:
Professor:

I. PROGRAM OUTCOME/S (PO) ADDRESSED BY THE LABORATORY EXERCISE


 Ability to demonstrate understanding and proficiency of IT specialization [PO: I]
 Ability to use and apply current technical concepts and practices in the core information technologies; human
computer interaction, information management, programming, networking and web systems and
technologies. [PO: J]

II. COURSE LEARNING OUTCOME/S (CLO) ADDRESSED BY THE LABORATORY EXERCISE


 Demonstrate an understanding of Disk Operating System (DOS) and LINUX history and concepts. [CLO: 1]
 Perform file and directory creation and manipulation using DOS commands; LINUX installation in virtual
machine, file and directory creation and manipulation, and system administration using LINUX commands.
[CLO: 2]

III. INTENDED LEARNING OUTCOME/S (ILO) OF THE LABORATORY EXERCISE


At the end of this exercise, students must be able to:
 Able to perform file and directory creation, and move between directories using LINUX commands
 Able to perform file and directory creation, and move between directories using LINUX commands

IV. BACKGROUND INFORMATION

CentOS
CentOS (/ˈsɛntɒs/, from Community Enterprise Operating System) is a Linux distribution that provides a free,
enterprise-class, community-supported computing platform functionally compatible with its upstream source, Red
Hat Enterprise Linux (RHEL). In January 2014, CentOS announced the official joining with Red Hat while staying
independent from RHEL, under a new CentOS governing board.

What is a virtual machine?


A virtual machine (VM) is an operating system (OS) or application environment that is installed on software, which
imitates dedicated hardware. The end user has the same experience on a virtual machine as they would have on
dedicated hardware.

VirtualBox
Offering versatile virtualization, VirtualBox can create a virtual machine with virtually any operating system (except
those intended for ARM devices). It also offers software and hard assisted virtualization, storing virtual machines as
disk images. This makes them easy to backup or migrate to other PCs or VM applications.

CPEOPSYSLA - Operating System Laboratory Page 2 of 7


VirtualBox is particularly good at running 32-bit and 64-bit Linux distros, as well as Windows. It’s even possible to
run OS X on VirtualBox.

Directory Commands
A. To display the contents of the current working directory
Syntax:
ls

Options that can be used with it.


-a
-A
-d
-l
-r
-R

B. To change directory
Syntax:
• cd . means the current directory
• cd .. means parent directory
• cd means will take you to your home directory
• cd – will take you to your previous directory
• cd ~ username will take you to the home directory of the user

CPEOPSYSLA - Operating System Laboratory Page 3 of 7


• cd <directory_name>
• cd <directorypath>

C. To make directory/directories
Syntax:
mkdir [-option] directory1 directory2 …
Examples:
To create directories dir1, dir2, dir3, on the current directory:
Syntax:
mkdir dir1 dir2 dir3
mkdir my\ folder

To create the directory /home/tester/mydir/testdir (mydir is not yet existing):


Syntax:
mkdir –p /home/tester/mydir/testdir

D. To remove directory
Syntax:
rmdir [-option] directoryname
*This command allows removing EMPTY directories.

Examples:
To remove the directory dir1
Syntax:
rmdir dir1

To remove the directory /home/tester/mydir/testdir and its parent directory


Syntax:
rmdir -p mydir/testdir

To remove directory that is not empty


Syntax:
rm -r directoryname
rm -rf directoryname

E. To print or display the current working directory.


Syntax: pwd

F. To clear the screen.


Syntax: clear

G. To display previously entered commands. This information is stored the ~/.bash_history file located at the home
directory of each user.
Syntax: history

CPEOPSYSLA - Operating System Laboratory Page 4 of 7


V. GRADING SYSTEM / RUBRIC (please see separate sheet)

VI. LABORATORY ACTIVITY:

PART 1: LINUX DIRECTORY AND FILE CREATION COMMANDS

Tasks / Procedure / Instructions:

A. Knowing your working directory and creating directories.

To create a new directory, use mkdir command.


Syntax: $ mkdir directoryname

1. Type the command pwd at your default prompt :~$


Paste your captured executed command below.

2. What is the meaning of pwd?


Answer:

3. Create a directory at your current directory. (Use your surname1_surname2 as your directory name)
Paste your captured executed command and output below.

4. Type ls to check the content of your current working directory.


Paste your captured executed command and output below.

CPEOPSYSLA - Operating System Laboratory Page 5 of 7


5. Create a directory tree. The following command will created a directory tree where dirC will be created under dirB and
dirB is created under dirA.
Type the command at your prompt :~$ mkdir –p dirA/dirB/dirC
Paste your captured executed command and output below.

B. Complete the table below:

Tasks Screen Shot of the Command(s)


1. Log-in using your account name.
2. Display the date and time.
3. Get the sum, difference, product, and quotient of 1205300
and 20.
4. Display the calendar for the year 1996 with month July
only.
5. Display the calendar for the month June in year 1990.
6. Display the calendar for the year 2002.
7. Clear the screen.
8. Create an ordinary file named sample1, sample2 and
sample3
9. Display all files in your current working directory. (filenames
only)
10. Display all files including the access security, group
name, filename, size, date and time last modified.
11. Display all files (hidden and non-hidden) including the
access modes, group name, filename, size, date and time last
modified.
12. Display the information about the ls command.
13. Find out who else is logged on to the system.
14. Display your account name.
15. Log-off to the system.

Observation:

CPEOPSYSLA - Operating System Laboratory Page 6 of 7


Conclusion:

VII. REFERENCES:
 Sobell, M., et al. (2017). A Practical Guide to Linux Commands, Editors, and Shell Programming, 4 th Ed. Addison-
Wesley Professional
 Cobbaut, P. (2016). Mastering Linux- Networking
 Blum, R., (2015). Linux Command Line and Shell Scripting Bible
 Fox, R., (2015). Linux with operating system concepts
 Sobell, M., et al. (2017). A Practical Guide to Linux Commands, Editors, and Shell Programming, 4 th Ed. Addison-
Wesley Professional
 Cobbaut, P. (2016). Mastering Linux- Networking
 Blum, R., (2015). Linux Command Line and Shell Scripting Bible
 Fox, R., (2015). Linux with operating system concepts

CPEOPSYSLA - Operating System Laboratory Page 7 of 7

You might also like