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

Introduction to It Systems Unit-2 (Set-1)

This document contains a question bank and solutions for an Introduction to IT Systems course, specifically focusing on Unix/Linux commands and concepts. It includes various questions categorized by Bloom's taxonomy levels, covering topics such as shell commands, operating systems, and file manipulation. The document serves as a study guide for students in their 1st and 2nd semesters for the academic year 2024-25.

Uploaded by

birbalkumar53
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Introduction to It Systems Unit-2 (Set-1)

This document contains a question bank and solutions for an Introduction to IT Systems course, specifically focusing on Unix/Linux commands and concepts. It includes various questions categorized by Bloom's taxonomy levels, covering topics such as shell commands, operating systems, and file manipulation. The document serves as a study guide for students in their 1st and 2nd semesters for the academic year 2024-25.

Uploaded by

birbalkumar53
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Question Bank & Solutions

(1st/2nd Semester 2024-25)


Introduction to IT Systems

UNIT-2 (SET-1)

Q.
No.
Question & Answer -2 marks each Bloom's
taxonomy
Level
1 Write any two major types of shells on most UNIX systems with their prompt Level 1
symbol.
Ans Two major types of shells available on most Unix systems with their prompt
symbol are as follows.
Shell prompt symbol
-------- ---------------------
Bourne Shell $
C Shell %

2 Write any two shell commands with their description and syntax. Level 1
Ans Two commands are,
a. Cd (change directory) : cd command is used to change the current
working directory.
Syntax: $ cd <directory name>
b. Mkdir : to create a new directory
Syntax: $ mkdir <directory name>

3 Explain ‘cd’ command available in Unix/Linux. Level 1


Ans the ‘cd’ command is used to change the current working directory.
Syntax: $cd <directory Name>
Various symbols can be used with the command. Symbols with their meaning are
as under:
Single dot (.) : current directory
Double dot(..) : upper directory / parent directory
Tilde (~) : home directory
4 Briefly write the procedure to remove a directory. Level 2
Ans To remove a directory ‘rmdir’ command is used. The directory must be empty
before trying to remove the directory. The syntax is,
$ rmdir <name of directory>
5 Distinguish between cat and touch command in UNIX/Linux? Level 4
Ans touch command helps the user to create one or more files simultaneously. The
cat command helps us to create, view and concatenate files.
Syntax of touch command to create a file:
$touch <filename>.<extension name>
Example of touch command to create a file:
$touch abc.txt
Syntax of cat command to create a file :
$ cat ><filename>.<extension name>
Example of cat command to create a file:
$cat > abc.txt
6 You are given a text file. Your job is to count the number of characters and Level 3
number of words in the file. Write the lines of code to do this task in
Unix/Linux.
Ans Let the text file be “file1.txt”
The line of code to count the number of characters will be,
$wc -c file1.txt
The line of code to count the number of words will be,
$wc -w file1.txt
7 List out any four popular operating System. Level 1
Ans Four popular operating systems are,
i. MS-Windows,
ii. Ubuntu,
iii. Solaris, and
iv. Android.
8 Computing now-a-days are mobile computing. Justify. Level 5
Ans The market share of android OS is approximately 40% which is highest as
compared to other existing operating systems. Hence the phrase ‘computing
now-a-days are mobile computing’ is justified.
9 Write brief procedure to create a bootable media. Level 2
Ans - Various freely available tools such as Rufus, Unetbootin etc, can be used
to create a bootable USB with ISO file.
- The user may write (burn) the downloaded ISO file on the CD/DVD and
make a bootable disc.
10 Explain the purpose of an Operating System in a Computer. Level 2
Ans The purpose of Operating system is to make sure the computer system performs
well by managing its computational activities. It also provides an environment for
development and execution of programs.
11 Define Kernel in the context of Operating System. Level 1
Ans A kernel is a backbone of the operating system that is loaded in to the memory
on system startup (boot-up time) and manages the overall system until
shutdown.

12 Define shell in Unix/Linux operating system. Level 1


Ans Shell is a utility program that starts up when we log on. Shell provides a platform
or environment by which any user can interact with the computer system by
typing commands. The shell interprets the commands typed by the user on the
command line or a script file.
13 Write four examples of Shells used in different Operating Systems. Level 1
Ans Sh-the Bourne Shell
bash-the Bourne Again Shell
csh-the C Shell
KDE and GNOME managers on Linux which provides graphical user interface.
14 List out some advantages of Operating System Level 2
Ans Some advantages of operating system are listed below:
 Provides working environment to the user
 Resource Sharing
 Hardware Accessibility
 Multitasking
 Data Security
15 Operating System plays major role in the Computer System. Justify it. Level 5
Ans The computer system consists of hardware components. Operating system
activates the hardware components in order to perform the desired task by the
user. Without operating system, the system cannot run. Hence, operating system
plays major role in the computer system.
16 Write the functions of keys dd, dw, C and D in vi editor. Level 1
Ans dd – Delete a line
dw – Delete word
C – Delete contents of a line after the cursor and insert new text. Press ESC to
end insertion.
D – Delete contents of line after the cursor.
17 Write the general format of Unix command syntax. Level 1
Ans The Unix command syntax consists of three parts: the command, a list of options
and arguments.
Syntax:
command <options><arguments>
Example:
cp file1.txt file2.txt
18 Is it possible to install the OS without formatting the partition, and what would Level 4
the situation be if the partition is not formatted?
Ans Yes, it is possible to install the OS without formatting the partition. If we don’t
format the partition, then the old data will be remained in the disk, but the OS
will be installed.
19 Explain functions of clear and echo commands in UNIX. Level 1
Ans The clear command clears the terminal.
Syntax: $ clear
The echo command helps the user to write a string to standard output device.
Syntax: $ echo <string>
Example: $ echo “hello world”
20 Write any two examples of Directory and File manipulation command, and two Level 1
examples of Terminal, information & utility command with their functions.
Ans Two examples of file directory and manipulation commands are,
pwd : prints the working directory
ls : lists the content of the directory
Two examples of Terminal, Information & Utility commands are,
clear: clears the terminal
echo : write a string to standard output device.
5 marks Questions & Answers
1 Discuss any five basic features of Unix/Linux shell. Level 1
Ans Basic features of all Unix/Linux shells are as below:
a. Prompt: Shell displays a character or group of characters (such as
$ or #) when it is ready to accept a new command.
b. Command interpretation: when a user enters a command, it is the
shell that determines which program to run in order to perform the
command.
c. Multitasking: users are provided the facility to run more than one
command at a time. It controls the jobs and lets us multitask.
d. Command history: shell keeps track of all the back-to-back supplied
commands. It enables the user to repeat the previous commands or
similar one.
e. Wildcards and Aliases: shell provides the functionality to use some
meta characters (e.g., an asterisk (*), question mark (?) , etc) to
abbreviate filenames or pathnames that match a certain set of
characters, known as wildcards. In addition, the shell enables a user
to avoid typing long commands using aliases.
f. Piping and I/O Redirection: Using this functionality, the output of one
program can directly be supplied to another program or file.

2 Create the following directory structure using UNIX/Linux bash shell. After Level 3
creation, delete the structure.

Ans $ mkdir Animal


$ cd Animal
$ mkdir Wild
$ mkdir Pet
$ cd Wild
$ touch tiger.txt
$ touch lion.txt
$ cd..
$ cd Pet
$ touch cat.txt
$~
$ cd Animal
$ cd Pet
$ rm cat.txt
$ cd..
$ cd Wild
$ rm tiget.txt
$ rm lion.txt
$ cd..
$ rmdir Pet
$ rmdir Wild
$ cd..
$ rmdir Animal
3 Write short notes on usages cat command. Level 2
Ans Cat command helps us to create, view and concatenate files. The cat command
can be used in the following ways.
To view a file:
Syntax: $cat <filename>
Example : $ cat abc.txt
view multiple files:
Syntax : $cat <filename1><filename2>
$cat abc.txt xyz.txt
to view content of a file preceding with line number ‘n’:
Syntax: $cat -n <filename>
Example: $cat -5 abc.txt
to create a new file
Syntax: $cat > [file name]
Example: $cat > abc.txt
to copy the contents of one file to another file
Syntax: $cat [source file] > [destination file]
Example: $cat abc.txt > xyz.txt
to append the content of file1 to file2
Syntax : $cat [file1] >> [file2]
Example: $ cat file1.txt >> file2.txt
4 There are two modes of operation in vi editor. Discuss each of them briefly. Level 2
Ans The two modes of operation available in vi editor are,
a. Command mode and
b. Insert mode
Command mode: The vi editor opens in the command mode. As the name
implies, this mode is used to perform some commands which in turn causes some
actions on the file. In command mode, we can move the cursor and cut, copy,
paste the text. Command mode also saves the changes which we made to the
file. Hence it performs administrative tasks for file editing. Commands in
command mode are case sensitive. Several commands are there for each task to
work with vi editor, but the commands must be entered in command mode.

Insert mode: this mode is used for inserting text into the file by vi editor.
Whatsoever is typed in this mode is treated as input and placed in temporary
memory and after a command from the user it goes to the file. To switch from
command mode to insert mode, the user need to press ‘i’ on the keyboard. You
need to press ‘Esc’ key to return from insert mode to command mode.
5 Explain the function of grep command briefly with suitable example. Level 2
Ans Grep command globally search for regular expression and print out. This
command searchesa file for a matchingpattern or regular expression.

The syntax of grep command:


Grep [options] <regular-expression><file-name>
Options:
-n print lines and line numbers where pattern matches
-v prints all the lines that do not contain the expression
-c prints only a count of the lines that match a pattern
-h displays the matched lines, but do not display the file name.

Example :
Let a text file “hockey.txt” which contains 2 lines content as follows.
India has won 11 medals in field hockey.
India has won 4 medals in in the shooting.
Case 1: Searching for specific Pattern
Syntax: grep "pattern" filename
This searches for the "pattern" in the specified file and prints all lines
that contain the pattern.
Example: grep "medal" hockey.txt
Case 2: Display Line Numbers
Syntax: grep –n "pattern" filename
Example: grep -n “medal” hockey.txt
The output will be,
1: India has won 11 medals in field hockey.
2: India has won 4 medals in in the shooting.
Here, the search pattern “medal” will be highlighted in the line with
line number 1 and 2.
Case 3: Invert Match
Syntax: grep -v "pattern" filename
This prints all lines that do not match the pattern.
Example: grep -v "medal" hockey.txt
Case 4: Counting Matches
Syntax: grep –c “pattern” filename
This counts the number of lines that match the pattern.
Example: Grep -c “medal” hockey.txt
The output will be, 2.
In this case the word “medal” occurs 2 times in hockey.txt, so the
output will be 2.
Case 5: Searching for specific Pattern from multiple filenames
Syntax: grep –h “pattern” filenames
This especially useful in the matching lines themselves, regardless of
which file they came from.
Example: grep –h “medal” hockey.txt file2.txt

6 Explain the major differences between Linux and Windows operating system. Level 4
Ans Key area Linux Windows
Kernel It is an open-source, Unix-like Windows uses a proprietary
operating system. The core of kernel developed by
the Linux OS is the Linux Microsoft. It is based on the
kernel, which is responsible Windows NT kernel, which
for managing hardware and has evolved over the years to
system resources. support modern hardware
and provide a user-friendly
experience.
Source Code Linux is open-source, which Windows is a closed-source,
Availability means the source code is proprietary operating
freely available. Anyone can system. The source code is
view, modify, and distribute it. not available to the public,
This gives users a high degree and users cannot modify the
of control and flexibility over core system. Microsoft
the operating system. maintains full control over
the OS.
User Linux typically uses various Windows has a consistent,
Interface (UI)
desktop environments like user-friendly interface
GNOME, KDE, and Xfce. These (starting with Windows 95 up
environments can be to the latest version,
customized to a high degree, Windows 11). It is known for
offering flexibility to users. its ease of use, with a Start
The interface may be more Menu, taskbar, and window-
technical, but many user- based design that most users
friendly distributions (like find intuitive.
Ubuntu) provide simple,
attractive interfaces.
System Linux can run on older or less Windows tends to require
Requirements powerful hardware. This more system resources (e.g.,
makes it a good choice for RAM, CPU power), especially
lightweight or resource- in newer versions. As a
constrained systems. result, it might not run as
efficiently on older hardware.
7 Explain UNIX architecture with a neat diagram Level 2
Ans The UNIX architecture is known for its simplicity, modularity, and robustness. It
consists of several layers that work together to manage the system. A typical Unix
System Structure is presented below.
Kernel:
A kernel is a backbone of the Unix operating system that is loaded into
the memory on system startup (boot-up time) and manages the overall system
until shutdown.

Shell:
A shell is a special program that acts as an intermediary between the user
and the Kernel of the operating system.Shell is a utility program thatstarts up
when we log on. Shell provides a platform or environment by which any user can
interact with the computer system by typing commands. The shell interprets the
commands typed by the user on the command line or a script file.
In this diagram:

 The User Interface is where users interact with the system, usually
through a terminal or graphical interface.
 The Shell processes user commands and requests services from the
kernel.
 The Utilities provide various tools and programs for file and system
management such as ls, cp, mv, grep, etc.
 The Kernel directly interacts with the hardware, managing resources and
system calls.

8 Using UNIX Shell Commands Level 3


a. Create a directory structure with a main directory named "Projects" that
contains subdirectories "Alpha," "Beta," and "Gamma." In "Alpha," create
three files named "report.txt," "data.txt," and "summary.txt."
b. Copy "report.txt" to the "Beta" directory and "data.txt" to the "Gamma"
directory.
c. Move "summary.txt" to the "Gamma" directory.
d. Delete the "Beta" directory.
e. Concatenate the contents of “data.txt” and “summary.txt” into
“summary.txt”
Ans a. Create the directory structure
mkdir Projects
cd Projects
cat > report.txt
India lifted the first cricket ODI world cup in 1983.
Press ctrl+d
cat > data.txt
India lifted the first cricket T20 world cup in 2007.
Press ctrl+d
cat > summary.txt
India lifted the second cricket ODI world cup in 2011.
Press ctrl+d

b. Copy files
cp Projects/Alpha/report.txt Projects/Beta/
cp Projects/Alpha/data.txt Projects/Gamma/

c. Move file
mv Projects/Alpha/summary.txt Projects/Gamma/

d. Delete Beta directory


rm Projects/Beta

e. Concatenate files
cat data.txt >> summary.txt
9 Discuss the step by step procedure to install Ubuntu OS in your system. Level 1
Ans - Plug the bootable media which includes Ubuntu OS into our system.
- Now we need to set the booting sequence to USB disk instead of HDD. This is
done by changing boot priority in the BIOS setting at the time of computer
start.
- Restart the computer and access to BIOS setting by pressing function keys F1
or F2 or F10 or F12 (or any other) depending on your BIOS and computer
manufacturer. It will show your BIOS screen (it may look differ, as per your
system). Give a higher priority to your USB drive.
- Save and exit BIOS settings.
- The booting process will begin once boot media is detected by the BIOS. The
installer will check the disk (file system). The system will prepare to install
Ubuntu operating system.
- After a while, we will see the Ubuntu 20.04 (or any other version) welcome
page. Here we have to click the Install Ubuntu option.
- Next, select the language and click continue.
- Thereafter, select the keyboard layout and click the continue.
- Now we need to select the types of apps we want to begin with. We may
choose any of the available options i.e., Normal or Minimal. We can instruct
the installer to update the ubuntu while installing by checking the checkmark
option.
- Then we need to choose, how we want to install the OS from the available
options. i.e., Erase disk and install ubuntu or something else.
- After confirmation, the disk will be erased accordingly and the installation
will continue.
- Select the time zone i.e., “Kolkata” then press continue.
- Then create login credentials and name of the computer.
- Restart the system to complete the installation.
10 Write short notes on shell commands. Level 2
Ans Shell commands consist of a single or more word separated by white spaces. The
first word is the command, and subsequent words are the options or arguments.

Syntax: Command <options><arguments>

There are two types of internal commands available in Unix, such as,
a. Directory and file manipulation command
b. Terminal, Information & Utility command

Directory and file manipulation command:


These commands are related to manipulate the file and directory.
Example: pwd, cd, ls etc. Some of the commands are explained below.

i. Pwd : print working directory


This command prints the complete path of the current working directory.
Syntax: $ pwd
ii. Cd: change directory
This command changes the current working directory.
Syntax: $ cd <directory name>
cd.  current directory
cd..  move to the parent directory.
Cd ~  move to home directory

Terminal, Information & Utility command:


These commands are related to terminal management only, such as
clear, echo, repeat etc.
i. Clear : clears the terminal
Syntax: $ clear
ii. echo : write a string to standard output device
Syntax: $ echo “hello world”
iii. repeat: repeats a command specified times.
Syntax: $ repeat <number><command>

You might also like