Operating Sys. Quiz 2 Flashcards

1
Q

Difference between “normal” user and “super-user/root”

A
  • “normal” users with a limited set of privileges on the system
  • “root” user is the system admin
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the shell?

A

The shell is essentially a program that allows you to launch other programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What symbol is used for normal users and what symbol is used for root users

A

$ or % for normals users
# for root users

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do command-line programs receive their inputs and outputs from

A

stdin for inputs
stdout to write their output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How can you redirect stdin and stdout

A

with the < (input) and > (output) redirection operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does wc -l my file > output.txt do?

A

sends the output of the wc command to a file called output.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What do we call “folders” in Finder and similar graphical file navigation tools?

A

Directories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can every file or directory in the filesystem can be located?

A

Using its full path name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does pwd, ls and cd do?

A
  • pwd stands for “print working directory”
  • ls stands for list the files. Use ls -l to get a “long” detailed listing
  • cd stands for “change directory”.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a shell wildcard?

A

A wildcard is a symbol that represents a group pf characters in a filename.
The bash offers two wildcards: “*” and “?”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between the :*” wildcard and the “?” wildcard.

A

“*” wildcard is a stand-in for zero or more consecutive characters
“?” wildcard is a stand-in for a single character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does echo * do? What about echo../???

A
  • list all the files ( and directories) in the current directory
    -lists all the 3 letter files in the parent directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you find the search path

A

Type “echo path” to display the places the shell searches when you type a command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are pipes?

A

”|”, pipes allow you to redirect the output of one program and make it the input of another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does ls -l *.txt | wc -l do?

A

this lists all .txt file one line at a time. wc then counts the number of input lines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does ls -l | awk ‘{print $5}’ do?

A

prints the size of the files in the directory because that appears in column #5 of the output ls -l

17
Q

what is awk -F ‘ ‘ ‘{print $n}’

A

Where n is the column of interest. And, optionally, the -F is the firstly separator

18
Q

what does this do:
cat etc/passwd | awk -F’:’{print $5}’ |sort

A

The cat command dumps the output of the file. The pipe redirects that output to the input of the awk filter which extracts the 5th column. The output of awk is redirected to the input of the sort filter which sorts it

19
Q

What are the file permission groups? In what order are the permissions? Each group starts at every __ letters?

A
  • user, group, other permissions
  • 3
20
Q

How do you change the permissions of a file? How would you take away or give a permission?

A
  • chmod myProg o+w
  • would give others write permission on the file myProg
21
Q

What is an operating system?

A

A program that acts as an intermediary between software applications and the hardware of a computer

22
Q

What is the CPU Instruction Cycle?

A

fetch, decode, execute

23
Q

What is a data wire?

A
  • a data wire is an electric wire used to pass inofrmation between two or more devices one bit at a time
  • a wire may hold voltage ( a binary 1) or may have no voltage ( a binary 0)
24
Q

What is a databus?

A
  • When multiple data wires connect a set of components is called a databus
  • A bus can simultaneously transfer as many bits of data as there are wires
  • the number of wires is called the bus width
25
Q

What is a conceptual abstraction? Logical abstraction?

A

C.A - Hides complexities of a real system not important in a particular context
L.A - provides a framework for discussing the logical organization of data or things

26
Q

What is the grep command? the tail command? What does this do:grep -i “UNix” geekfile.txt? this tail -n 3 state.txt

A
  • grep is a command used for searching and matching text patterns in files contained in the regular expressions
  • primarily used to output the end of a (text) file or to limit the output of a Linux command.
  • The -i option enables to search for a string case insensitively in the given file. It matches the words like “UNIX”, “Unix”, “unix”.
  • Prints the last ‘num’ lines instead of last 10 lines. num is mandatory to be specified in command
27
Q

How would you estimate the number of files in the iTunes.app directory

A

ls -l /Applications/iTunes.app | wc -l

28
Q

How to list all commands in the history that made use of the grep command or filter

A

history | grep -e ‘grep’

The history command displays the history of commands typed at the command prompt

29
Q

Describe the role of a modern operating system. (your answer should include hardware abstraction and resource allocation and management). Provide examples.

A

A modern operating system’s functions include resource allocation and management, which involves effectively allocating and managing system resources, and hardware abstraction, which creates a layer of abstraction between software and hardware. Linux, macOS, and Windows are a few examples.

30
Q

What are the four main areas of concern for operating systems? Describe each and the O/Ses role in the management of each.

A
  • Process management (controlling applications that are currently running)
  • memory management (controlling system memory)
  • file system management (arranging and retrieving data from storage)
  • device management (managing hardware devices) are the four primary areas of interest for operating systems.
  • Task scheduling, memory management, file system organization, and device driver handling are all responsibilities of the operating system.
31
Q

What is a system bus? Your answer should include a discussion of the data bus and the address bus.

A

The communication channel that links the CPU, memory, and additional peripheral devices is called a system bus. It is made up of an address bus for memory location specification and a data bus for data transfer.

32
Q

Describe the basic components of a computer system and discuss how they are interconnected by the system bus.

A

The CPU, memory, storage devices, and input/output devices are the fundamental parts of a computer system. These parts are connected to one another via the system bus, which enables communication between them.

33
Q

What is meant by a memory-mapped I/O device?

A

a piece of hardware thatthe CPU can interact with through memory read and write operations. Its control
registers are mapped to the system’s memory address space.

34
Q

What is a dual-mode operating system? Your answer should include CPU modes and
trapping.

A

User mode and kernel mode are the two modes of an operating system that is
dual-modal. While kernel mode permits full access for privileged operations, user mode limits access to crucial system resources. Switching between modes is done with a trap.

35
Q

Which is heavier: 10E5 nanogram or .01 milligrams? Explain.

A

10e5 nanograms is heavier than .01 milligrams 10e5 nanograms = .1 milligrams .1 milligrams > .01 milligrams

36
Q

Which is longer: 789 Megaweeks or 123 Teraseconds?

A

Because 1 Megaweek is equal to 1 million weeks and 1 Terasecond is equal to 1
trillion seconds, 789 Megaweeks is longer than 123 Teraseconds.

37
Q

Briefly, describe the operation and function of each component of the CPU (CU, MMU,
ALU).

A

The Control Unit (CU) is in charge of organizing and managing instructions;
the Memory Management Unit (MMU) handles memory-related tasks;
the Arithmetic Logic Unit (ALU) handles logical and mathematical calculations.