CPSC4240 Midterm 1

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/160

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

161 Terms

1
New cards

What is the command to set permissions for a file1.c using octal form with owner having all permissions, group having read and execute, and world having nothing?

sudo chmod 750 file1.c

2
New cards

Why is stdin a softlink?

3
New cards

Where does the stdin softlink point?

/proc/self/fd/0

4
New cards

What is the command to create a softlink?

ln -s filename softlink_name

5
New cards

Which directory is the window into the hardware world?

/dev

6
New cards

What is a virtual machine?

software that emulates a computer system with its own virtual cpu, network interface, and storage in the user space in the existing OS as an independent process

7
New cards

What is the hypervisor?

the virtual machine manager (ex: UTM)

8
New cards

Where does a virtual machine run?

on top of the host operating system

9
New cards

What does AT&T stand for?

American Telephone and Telegraph

10
New cards

What does DARPA stand for?

defense advanced research projects agency

11
New cards

In which system did open source movement start?

GNU

12
New cards

What does GNU stand for?

GNU not Unix

13
New cards

Who created Linux?

Linus Torvalds

14
New cards

What does GPL stand for?

general public license

15
New cards

What is copyleft?

if you make a derivative work from something open source, it can't have a stricter license than the original

16
New cards

Where was Linus Torvalds from?

Finland

17
New cards

What is a distribution of Linux?

the kernel and packages

18
New cards

What family is Ubuntu in?

debian

19
New cards

Who created Ubuntu?

Mark Shuttleworth

20
New cards

What is the naming convention of Ubuntu versions?

year and month of release (ex: 24.04 = April 2024)

21
New cards

How many versions of Ubuntu are released a year?

two

22
New cards

What months are the two versions of Ubuntu released?

April and October

23
New cards

What release of Ubuntu has long term support every year?

April version

24
New cards

What is open source?

basically when the code is available to everyone so they can modify, play with, and create their own version of it

25
New cards

What does BIOS stand for?

basic input output system

26
New cards

What is BIOS?

firmware that initializes hardware on the motherboard

27
New cards

What does BIOS do?

gets system ready to load and run the OS

28
New cards

What is a hardware partition?

a logical division of hard drive

29
New cards

What is the naming convention of sata drive partitions?

ex: sda2, first drive, second partition

30
New cards

Outline the Boot process.

1. the system powers up, BIOS does hardware init

2. boot loader calls kernel

3. kernel loads initial RAM disk that loads system drives and finds root file system

4. after kernel is set, systemd init system starts

5. systemd takes over to mount host's file system and starts services

31
New cards

What is the name of the kernel?

vmlinuz

32
New cards

What does the master boot record (MBR) contain?

a table with the boot loader and partition table

33
New cards

Who came up with UEFI?

Intel

34
New cards

What does UEFI stand for?

unified extensible firmware interface

35
New cards

What are the password stages?

1. BIOS password

2. hard drive password

3. user password

36
New cards

What does GRUB stand for?

grand unified boot loader

37
New cards

What are the three init systems?

sysVinit, Upstart, and systemd

38
New cards

What are daemons?

kernel background processes that start autonomously after booting

39
New cards

What kinds of PIDs do daemons have?

low numbers, ex: systemd = PID 1

40
New cards

How can you check how long each service takes to start?

system-analyze

41
New cards

What are the three types of users?

root, sudoers, standard

42
New cards

What can each group of users do?

root = anything, standard = certain privileges (PLP), sudoer = standard user that was explicitly given permission to do something

43
New cards

What is the Principle of Least Privilege (PLP)?

when you give a user the least amount of privilege possible for them to complete the things they need to be able to do

44
New cards

What does pwd do?

print working directory

45
New cards

What does ls -l do?

shows everything in your directory in long list format (shows pid, parent, etc)

46
New cards

What does ls * do?

pattern seeking, anything you put after the , your system will pull up (ex: ls .c pulls up all .c files)

47
New cards

What is a process?

an instance of a computer program

48
New cards

What is the PCB?

process control block, data structure in the kernel with the information needed to schedule the process

49
New cards

What memory allocations does a process have?

data, instructions, stack, heap

50
New cards

What does the stack hold for a process?

function activation

51
New cards

What does the heap hold for a process?

dynamically allocated entities

52
New cards

What directory are processes in?

/proc

53
New cards

What is in the boot directory?

kernel (vmlinuz)

54
New cards

What is the first process created?

55
New cards

What is the process with PID 0?

the scheduler

56
New cards

Why can't we see PID 0 in the system?

57
New cards

What is the process with PID 1?

systemd

58
New cards

What does systemd do?

adopts ophans, reaps zombies, handles signals for children

59
New cards

How do processes create other processes? Is there a command?

fork()

60
New cards

What is an orphan process?

created when a parent dies, normally adopted by systemd

61
New cards

What is a zombie process?

created when a child doesn't wait() for it's parent (process has been completed but still remains in process table due to lack of correspondence between parent and child)

62
New cards

What does top show?

processes in real time

63
New cards

What does ps show?

a snapshot of processes at that moment

64
New cards

What does pstree show?

a snapshot that displays processes in a tree format

65
New cards

What does pgrap do?

returns matching PID for process

66
New cards

Where does a child get its niceness (priority)?

from its parent (set with nice and adjust with renice)

67
New cards

What is a runaway process?

a process that consumes more resources than expected

68
New cards

Are daemons orphans?

yes, intentionally

69
New cards

What does cron do?

runs commands on a schedule

70
New cards

What does anacron do?

runs skipped processes as soon as system boots up

71
New cards

What is a filesystem?

a way to organize and store files

72
New cards

What filesystem does our version of Linux use?

ext4

73
New cards

What are the most common filesystems?

Fat32, NTFS, HtS+, Btrfs, Swap FS

74
New cards

What did ext3 introduce?

journaling!

75
New cards

What is journaling?

when the system writes data to another part of the hard drive and notes the necessary changes to a log incase of a power failure or something that would cause inconsistencies

76
New cards

What are the three journaling levels?

jornal, ordered, writeback

77
New cards

Why does Linux support so many different filesystems?

because it was made to be flexible and customizable

78
New cards

What kinds of items live in a filesystem?

files, directories, and devices

79
New cards

What are the two kinds of devices?

block devices and character devices

80
New cards

What is a character device?

communicates with driver through stream of characters

81
New cards

What is a block device?

communicates with driver through fixed size blocks of data

82
New cards

How do you know if a device is a block or character device?

first character on the permissions string

83
New cards

What are the two forms of permissions?

octal and mnemonic

84
New cards

What are octal permissions?

the numerical way of setting permissions (ex: chmod 740 --> gives user all, group read, and other none)

85
New cards

What are mnemonic permissions?

the alphabetical way of changing permissions (ex: chmod u=rwx, g=r, o= filename --> gives user all, group read, and other none)

86
New cards

What is umass?

user mask, the default permissions for the files and directories you create (subtract from 777 or 666)

87
New cards

How do you see what your umass is?

command "umass"

88
New cards

How do you change/set your umass?

"umass number"

89
New cards

What is in /bin?

binaries, executables

90
New cards

What is in /boot?

grub, kernal image (vmlinuz)

91
New cards

What is in /dev?

files associated with device drivers, stdin, stdout, stderr

92
New cards

What is in /etc?

config files, passwd, shadow, group, sudoers, etc.

93
New cards

What's in /home?

holders for every user in the system

94
New cards

What's in /mnt?

mount point (mounting an external filesystem to yours, hiding existing files if you mount over it)

95
New cards

What is in /opt?

third party software (ex: zoom)

96
New cards

What's in /sbin?

super user binaries

97
New cards

What's in /usr?

everything a user might need to do their work

98
New cards

What's in /var?

files that vary in size like log files

99
New cards

What are inodes?

index nodes that are assigned by kernel when a file is created

100
New cards

What command displays inodes for you to see in a directory?

ls -i