Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the Multple Choice Questions and the code for problem 6in the end PROBLEM 1: General UNIX 1. What is UNIX? a) an operating system

Answer the Multple Choice Questions and the code for problem 6in the end

PROBLEM 1: General UNIX

1. What is UNIX?

a) an operating system

b) a text editor

c) programming language

d) software program

Answer:

2. In which language UNIX is written?

a) JAVA

b) Python

c) C++

d) C

Answer:

3. Which of the following is not a feature of UNIX?

a) multitasking

b) multiuser

c) portability

d) easy to use

Answer:

4. Which of the following is not a part of all the versions ofUNIX?

a) Kernel and Shell

b) Commands and utilities

c) Graphical user interface

d) System Calls

Answer:

5. Which of the following is not true about UNIX?

a) Many people can use a UNIX based computerat the same time; hence UNIX is called as a multiuser system

b) A user can run multiple programs at thesame time; hence UNIX is called a multitasking environment

c) UNIX was not written in ‘C’ language

d) Linux is also known as a version ofUNIX

Answer:

6. POSIX is a set of standards specified for establishingcompatibility between operating systems.

a) True

b) False

Answer:

7. Shell is a command interpreter used for interacting with aUNIX system.

a) True

b) False

Answer:

8. Which part of the UNIX operating system interacts with thehardware?

a) Kernel

b) Shell

c) vi editor

d) application program

Answer:

9. Two UNIX systems may or may not use the same set of systemcalls.

a) True

b) False

Answer

10. What is a superuser?

a) system manager

b) normal user

c) administrator

d) a user with special rights

Answer:

PROBLEM 2: Commands

1. What are Commands?

a) specific instructions for performing aparticular task

b) part of the operating system

c) part of the shell

d) special instructions

Answer

2. In how many categories, commands of UNIX operating systemclassified?

a) 1

b) 2

c) Many

d) 0

Answer:

.

3. Which command is used for extracting the details of theoperating system?

a) cd

b) echo

c) uname

d) wc

Answer:

4. The sequences of directories that a shell searches whilelooking for a command is specified in the PATH variable.

a) True

b) False

Answer:

5. Options are also arguments but begin with a -.

a) True

b) False

Answer:

6. Which of the following is not a valid option of uname?

a) -a

b) -s

c) -v

d) -z

Answer:

.

7. How can we specify more than one command in the command lineat the same time?

a) using ;

b) using >

c) using ==

d) not possible

Answer:

8. Which command is used to display the documentation ofcommands in UNIX?

a) help

b) search

c) whatis

d) man

Answer:

9. Which command is used for displaying date and calendar inUNIX?

a) date and cal

b) DATE and CAL

c) date and calendar

d) dt and cl

Answer:

10. What is the output of who command?

a) display information about users who arecurrently logged in.

b) display file hierarchy

c) display administrator information

d) display processes

Answer:

11. What are meta-characters?

a) special characters having predefinedmeaning to the shell

b) special symbols

c) shell symbols

d) command symbols

Answer:

12. Which command is used for displaying date in the formatdd/mm/yyyy ?

a) date +%m

b) date +%h

c) date +”%d/%m/%Y”

d) date +”%h %m”

Answer:

PROBLEM 3: General Purpose Commands - 1

1. echo command is used for _________

a) displaying errors

b) displaying operating system details

c) displaying diagnostic messages

d) displaying date and time

Answer:

2. What are escape sequences?

a) special characters beginning with a (backslash)

b) special commands

c) special utilities

d) a sequence of characters

Answer:

3. Which of the following is not a valid escape sequence inUNIX?

a)

b) t

c) v

d) d

Answer:

4. Which command is used as an alternative to echo command?

a) ls

b) printf

c) wc

d) ps

Answer:

5. For what purpose bc command is used?

a) as a calculator

b) as an editor

c) as a process table viewer

d) for copying files

Answer:

6. script command is used for___________

a) recording history

b) recording our session

c) recording passwords

d) recording scripts

Answer:

7. Which of the following is a valid option with scriptcommand?

a) -b

b) -a

c) -d

d) -x

Answer:

8. mailx command is used for sending and receiving emails.

a) True

b) False

Answer:

9. Which of the following function cannot be performed by mailxcommand?

a) sending and receiving emails

b) reply to the sender

c) forward, delete and print mails

d) un-send mails

Answer:

10. Which of the following is not an internal command used bymailx?

a) N

b) d

c) q

d) a

Answer:

11. -h option is used with who command for what purpose?

a) display output with header information

b) display output with a more detailedversion

c) display output with trailerinformation

d) display output in columnar form

Answer:

12. Two or more users can have same login name in the output ofwho command.

a) True

b) False

Answer:

PROBLEM 4: General Purpose Commands - 2

1. history command displays the log of recently usedcommands.

a) True

b) False

Answer:

2. Which command is used by the user to change their loginpassword in UNIX?

a) man

b) reset

c) passwd

d) cp

Answer:

3. Which command handles a character stream by duplicating itsinput?

a) tree

b) tee

c) tty

d) ls

Answer: .

4. We can use man command for displaying the documentation ofman itself.

a) True

b) False

Answer:

5. When backspace doesn’t work to erase characters, we can use_____

a) ctrl-f

b) ctrl-h

c) ctrl-c

d) ctrl-u

Answer:

6. For interrupting a command, we can use _____

a) ctrl-f

b) esc

c) ctrl-h

d) ctrl-c

Answer:

7. Ctrl-S stops scrolling of screen output and ________

a) locks terminal

b) delete a character

c) locks keyboard

d) delete a line

Answer:

8. Which control unlocks the keyboard?

a) ctrl-u

b) ctrl-c

c) ctrl-z

d) ctrl-q

Answer:

9. Which command is used for killing a line?

a) ctrl-k

b) del

c) esc

d) ctrl-u

Answer:

PROBLEM 5: UNIX Editor

1. Which one of the following statement is not true?

a) vim editor is the improved version of vieditor

b) vi editor commands are not casesensitive

c) vi editor has two modes of operation:command mode and insert mode

d) vi stands for visual editor

Answer:

2. Which command is used to close the vi editor?

a) q

b) wq

c) both q and wq

d) none of the mentioned

Answer:

3. In vi editor, the key combination CTRL+f

a) moves screen down one page

b) moves screen up one page

c) moves screen up one line

d) moves screen down one line

Answer:

4. Which vi editor command copies the current line of thefile?

a) yy

b) yw

c) yc

d) none of the mentioned

Answer:

5. Which command is used to delete the character before thecursor location in vi editor?

a) X

b) x

c) D

d) d

Answer:

6. Which one of the following statement is true?

a) autoindentation is not possible in vieditor

b) autoindentation can be set using thecommand ‘:set ai’

c) autoindentation can be set using thecommand ‘:set noai’

d) autoindentation is set by default in vieditor

Answer:

7. Which command searches the string in file opened in vieditor?

a) / or ?

b) f or F

c) t or T

d) none of the mentioned

Answer:

8. In vi editor, which command reads the content of anotherfile?

a) read

b) r

c) ex

d) none of the mentioned

Answer:

9. Which command shows all the abbreviations in vi editor?

a) ab

b) abb

c) show

d) none of the mentioned

Answer:

10. Which command sets the number for all lines?

a) :set li

b) :set ln

c) :set nu

d) :set nl

Answer:

:

PROBLEM 6:

Write a shell/bash program which would prompt the user to enteran integer number and then

Would print the factorial of that number on the stdout/terminal

Example:

Enter a an integer: 7

The factorial of 7 is: 5040

PROBLEM 7::

Write a shell/bash program which would reads lines of text froma Prob7file.txt and prints out the line numbers and the number ofwords the line has.

Line 1 has 10 words

Line 2 has 15 words

:

:

:

Step by Step Solution

3.48 Rating (148 Votes )

There are 3 Steps involved in it

Step: 1

1 UNIX is an operating systema 2 UNIX is written in C d 3 Easy to use is not a feature of UNIX d 4 Graphical user interface is not a part of all the versions of UNIX c 5 UNIX was not written in C lang... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing and Assurance services an integrated approach

Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley

14th Edition

133081605, 132575957, 9780133081602, 978-0132575959

More Books

Students also viewed these Electrical Engineering questions