Simple Flashcards

1
Q

install command?

A

install [OPTION]… [-T] SOURCE DEST
install [OPTION]… SOURCE… DIRECTORY
install [OPTION]… -t DIRECTORY SOURCE…
install [OPTION]… -d DIRECTORY…

-copies files like cp
-can overwrite existing files
-creates destination directory if it does not exist
-can set permission tags
-sets files owners
-can remove non-essential baggage

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

history command?

A

history
-displays without options since the start of the terminal session

history 5
-displays the last 5 commands

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

What is Bash?

A

command language interpreter for the GNU operating system. “Bourne-Again SHell”, pun on Stephen Bourne, author of sh.

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

What is a shell?

A

macro processor that executes commands.
-macro as in text and symbols are expanded to create larger expressions.

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

Bios

A

First software that runs. identifies computer hardware, configures it, tests it, and connects it to the OS for further instructions (boot process).

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

Boot Loader

A

Provides UI for user to load OS and applications.

brings system to a state in which it can perform its main function.

onboard bootloader resides in in an area of ROM or flash memory that is protected from getting written over.

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

RAM

A

Random Access Memory. Volatile type storage. all data in RAM is deleted when device is turned off.

requires power to store data.

stores data for current instruction processing.

1-256GB data storage.

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

ROM

A

Read only memory. can only read data. non-volatile (permanent memory).

does not require power to store data.

stores data to start or bootstrap a computer

4-8MB data storage

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

CPU

A

Central Processing Unit. Accesses RAM and ROM. Instructions stored in RAM, and understands how to respond to RAM instructions from ROM.

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

Binary / Octal / Hexadecimal

A

root2, root8, and root16 number systems.
10/2 = 5R0
5/2 = 2R1
2/2 = 1R0
1/2 = 0R1
10 in binary is 1010

21/16= 1.3125 //0.3125*16=5
1/16 = 0R1
21 in hex is 15

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

Kernel

A

Core program that does all of the talking between the hardware and the software.

UI sends request to appropriate kernel, kernel sends request to CPU.

Kernel manages CPU, GPU, Memory, I/O devices, resource management, memory management, device management, system calls.

Kernel protects hardware.
Monolithic Kernel: OS and Kernel run in the same memory space. poor secuity.

microkernel: stripped down monoliithic kernel, prone to crashing systems.

hybrid: most commonly seen kernel,moves out drivers but keeps system services inside the kernel.

nano kernel: majority of its functions are set up outside the kernel,

exo-kernel: has process protection and resource handling, used for in-house testing and upgraded kernel types.

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

System Call

A

Is a transition or communication from user space to kernel space. ‘syscall’ examples include Open, Read, Write, Close, Wait, Exec, Fork, Exit and Kill.

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

Bits vs Bytes

A

both are units of data. one byte is 8 bits.

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

Bash Command: man

A

used to display the user manual of any command that we can run on the terminal

man sleep

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

Bash Command: cat

A

cat [option] [file]

cat > myfile.txt
adds the next input as text into myfile.txt

cat myfile.txt
displays content of myfile.txt to terminal

cat myfile.txt»myfile1.txt
copies myfile.txt to end of myfile1.txt

cat –n myfile1.txt
displays content but with line numbers

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

Bash command: echo

A

in a bash, will ‘state’ or print to console

17
Q

Bash Command: who

A

who // pulls system and login info from /var/run/utmp. pass a different file path for a different file path

who -b // prints time of last system boot
who -d // lists all dead processes
who -r // outputs current run level
who -q / who –count //user names and curently logged in users.
who -a / who –all // prints all informations

18
Q

Bash Command: whoami

A

displays currently logged in user. can confirm succesful account change.

sudo whoami // checks if you have sudo privellages.

19
Q

Bash Command: sleep

A

sleep .8

will sleep .8 seconds

20
Q

Bash Command: ifconfig

A

interface configuration. used at boot time to set up interfaces as necessary. after that, used for debugging and system tuning.
ifconfig interface up/down //de/activates interface’s driver

https://www.geeksforgeeks.org/ifconfig-command-in-linux-with-examples/

can be used to de/activate interface drivers, ARP protocols, IPv6, and more

21
Q

Bash Command: sudo

A

grants admin access, or admin right to current command

22
Q

Bash command: alias

A

alias ll =”ls -la”

only available during current session

23
Q

Bash Command: ls

A

lists directories

ls -l
lists content of current directory

24
Q

Bash Command: cp

A

cp grades.txt documents
copies grades.txt to documents folder

25
Q

Bash Command: mv

A

movies files and folders
mv source -f target //forces an overwrite
mv source -i target //prompts confirmation before overwriting

26
Q

Bash Command: mkdir

A

creates new folder/directory
mkdir cat_files

27
Q

Bash Command: touch (edited)

A

touch myfile.txt

creates myfile.txt in current directory.

28
Q

Explain the difference between the numeric literals 5 and 5.0

A

Integer VS floating point type

29
Q

What is the difference between the if-else statement and the conditional expression?

A

one is a single programming statement, the other is a programming block with statements.

Conditional operator can be used to assign a value to a variable, while the if-else statement cannot be used for assignment purposes.

30
Q

declare int function “IsRight” taking 3 floats “a, b, c” as variables

A

static int IsRight(float a, float b, float c);

31
Q

Conditional Expression. if a is greater than b, assign 1 to c. else assign 0.

A

c = (a>b) ? 1 : 0;

32
Q

for(i=0 ; i<10 ; i++)

when does the initialization expression run?
test expression?
update expression?

A

excutes once, before the first iteration,
tests before every iteration. terminates loop if false.
executes after every iteration. will not run if test was false.

33
Q

Bash Command: Bash

A