Midterm Exam Flashcards

1
Q

Operating System

A

Coordinates and applies the various parts of the computer – the processor, the on-board memory, the disk drives, keyboard, video monitors, and mouse to perform useful tasks. The operating system is the central most software program in the machine. It is the mechanism that connects all the internal and external components with administers, programmers, and system users.

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

Standard input - (stdin)
output - (stdout)
error - (stderr)

A

In computer programming, standard streams are preconnected input and output communication channels between a computer program and its environment when it begins execution. The three I/O connections are called standard input (stdin), standard output (stdout) and standard error (stderr).

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

What is a unary operator?

A

The unary operators operate on a single operand and following are the examples of Unary operators: The increment (++) and decrement (–) operators. The unary minus (-) operator. The logical not (!) operator.

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

File descriptors (FD) (integral values)

A

an abstract indicator (handle) used to access a file or other input/output resource, such as a pipe or network socket. File descriptors form part of the POSIX application programming interface.
Standard input: File descriptor 0 is open for reading.
Standard output: File descriptor 1 is open for writing.
Standard error: File descriptor 2 is open reading.

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

Dependency line

A

a line with a colon (:)

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

Data structure

A

a specific way of storing and organizing data in a computer so that it can be accessed with high efficiently. Data structures can be used as a single place for storing unrelated information
Some common data structures: array, hash table, linked list, queue, and stack

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

umask file and directory base permissions

A
666 = default file permission setting
777 = default directory permission setting
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Perl data types

A

singular, array, and hash

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

Perl utilizes dynamic data typing

A

in a dynamically typed language, every variable name is (unless it is null) bound only to an object

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

Perl relational operators (string, and numeric)

A
Numeric	    String	     Meaning	
      >	        gt	 Greater than
    >=            	ge     Greater than or equal
      <   		 lt      Less than
    <=		le	 Less than or equal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Perl Equality operators (string, and numeric)

A

Numeric String Meaning
== eq Equal to
!= ne Not equal to
 cmp Comparison, sign results
-1 if the left operand is less than right operand
0 If both operands equal to right operand
1 If the left operand is greater right operand

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

Interpolation

A

the process of evaluating a string literal containing one or more placeholders, yielding a result in which the placeholders are replaced with their corresponding values
ex: $statement = “I exercise my $animal”;
(string with interpolation)

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

Single back tick ( ) quotes

A

Used for command substitution.

Example: echo The date is date (interpolation)

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

Single quotes

A

‘ ’ - Literal quotes. Removes the special meaning of all enclosed characters. A single quote cannot appear within single quotes because a single quote denotes the end of the string.

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

Double quotes

A

“ “ - Double quotes. Removes special meaning of all enclosed characters, except $, `, “, and .
Example: print “The price is $Price.\n”; (interpolation)

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

Regular Expression

A

A regular expression (abbreviated regex or regexp) is a sequence of characters that forms a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. “find and replace”-like operations.

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

makefile

A

Make goes through the makefile (descriptor) file first starting with the target it is going to create. Make looks at each of the target’s dependencies to see if they are listed as targets. It follows the chain of dependencies until it reaches the end of the chain and then begins backing out and executing the commands found in each target’s rule. Actually every file in the chain may not need to be compiled. Make looks at the time stamp for each file in the chain and compiles from the point that is required to bring every file in the chain up to date. If any file is missing it is updated if possible.

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

Inode attributes

A

The size of the file in bytes.
Device ID (this identifies the device containing the file).
The User ID of the file’s owner.
The Group ID of the file.
The file mode which determines the file type and how the file’s owner, its group, and others can access the file.
Additional system and user flags to further protect the file (limit its use and modification).
Timestamps telling when the inode itself was last modified (ctime, inode change time), the file content last modified (mtime, modification time), and last accessed (atime, access time).
A link count telling how many hard links point to the inode.
Pointers to the disk blocks that store the file’s contents (see inode pointer structure).

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

Inode number

A

also called as index number
To check inode number of file use following command, first field in ouput is an inode number.
# ls -il tecadmin.txt
1150561 -rw-r–r– 1 root root 0 Mar 10 01:06 tecadmin.txt

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

link

A

A hard link directory entry is a direct pointer to a file inode. A soft link is a pointer to another directory entry.
The ln command is used to create a hard and soft link.

Hard link (physical):
	ln original_file.txt hard_link.txt
Soft link (symbolic):
	ln –s original_file.txt soft_link.txt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

process

A

The UNIX kernel can keep track of many processes at one time, and dividing it’s time to other system tasks. Each process submitted to the kernel is assigned a unique process ID (PID). In every version of UNIX, the PID range is 0 through 32,000 and is restrained to 5 digits.

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

daemon

A

Daemon processes execute in the background and their existence is under the radar screen. Users don’t know they exist unless they look for them on the system. Daemons execute waiting for data to be passed to them from some application, such as, a database, network, or printer daemon waiting for a print command. Daemon processes normal are known as service providers.

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

zombie

A

When a process is terminated or terminates on its own, but only partially exits the system, its presence can be displayed on the system as being in a Z state. This is a zombie, or defunct process on the system. A zombie is a process that completed execution, and is dead (walking dead). It does not consume system resources. It retains an entry in the process table. A good process display command is ps –aux.

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

orphan

A

Normally, when a child process is terminated, the parent process receives a SIGCHLD (code 17) signal from the kernel. After the parent receives the SIGCHLD signal, the parent can perform any last minute task or restart a new child process prior to the termination of its child. However, if the parent is terminated prior to its child process, the child process is left without a parent. This situation results in the child process becoming an orphan and the init process becomes its new parent process. The orphan process will then be assigned a PPID of 1.The term used to best describe the init processes action is re-parenting

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

filehandle

A

Filehandle is utilized for both input and output files. Most file names are cryptic and are meaningless to programmers. The purpose of a filehandle is to help the programmer remember a simple file name throughout a program.
A filehandle is a name given for a file, device, socket, or pipe.
Filehandle command line format:
open(filehandle, file name, permissions, chmod);

Example: open($FH,$file_name);

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

pipe symbol

A

|
Users can connect the standard output of one command into the standard input of another command by using the pipeline operator (|).

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

interactive process

A

Processes that require users to be active participants (like processing Excel) must execute in the foreground in order to run. These jobs are termed “interactive,” and must periodically update the display monitor, and accept input from the user, and allow access to the terminal interface.

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

ANSI

A

The American National Standards Institute is a private non-profit organization that oversees the development of voluntary consensus standards for products, services, processes, systems, and personnel in the United States.

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

CLI (first generation) and GUI (second generation)

A

The textual (command line) and the visual (graphical user) interfaces are the two most common modalities used to support engineers in network and system administration positions. The command line interface is recognized as the first generation and the graphical user interface is considered the second generation. Currently, research is trying to determine the next best interface. The command line interface is known as, “under the hood” method of interacting with the operating system.

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

Absolute (full) and relative (directory relative to another path) paths

A

A pathname starting with a slash is called anabsolutepathname, since it always starts at the ROOT.
All other pathnames (with no leading slash) are calledrelativepathnames. These relative pathnames are evaluatedrelative tothecurrent working directory. Relative pathnames (no leading slash) always start in the current directory, not in the ROOT directory.

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

PATH

A

The PATH variable sets the path for a session, which is a colon-delimited list of directories in which UNIX-like systems search for executable programs when you type a program name.

PATH=$HOME/bin:/opt/ant/bin:/opt/Lang/jdk1.3.0/j2sdk1_3_0/bin:
/usr/local/bin:/bin:/usr/bin:/opt/mysql/bin:/opt/WWW:/opt/Mail:
/opt/Lang/Perl/lib:/usr/local/lib:/usr/local/ssl/lib:/usr/local/pvm3/include:
/usr/ucb:/opt/sfw/bin:$HOME:.

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

TERM

A

holds the name of the current terminal type.

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

HOME

A

variable points to your home directory.

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

All variables (with their associated values) known to a command at execution time constitute its environment.

A

One way a shell lets you customize your working environment is by using shell variables. A shell variable is an item, known by a name, that represents a value of some type. As the term “variable” implies, the value of a shell variable can be changed.
There are two types of shell variables. First, there are variables that act as off/on switches. Second, there are variables that store a particular value as a string of characters.

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

/tmp

A

In Unix and Linux, the global temporary directories are /tmp and /var/tmp. Web browsers periodically write data to the tmp directory during page views and downloads. Typically, /var/tmp is for persistent files (as it may be preserved over reboots), and /tmp is for more temporary files.

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

/bin

A

On most Unix-like systems, the /bin directory contains the shell scripts and system commands. This subdirectory to the root directory contains the executable scripts, which are ready to run.

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

/etc

A

contains the configuration files for the system.

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

/proc

A

includes a directory for each running process, including kernel processes, in directories named /proc/PID, where PID is the process number. Each directory contains information about one process, including: /proc/PID/cmdline, the command that originally started the process.

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

/dev

A

The /dev directory contains the special device files for all the devices. The device files are created during installation, and later with the /dev/MAKEDEV script.

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

makefile

A

Comments within a makefile (#)
makefile continuation lines ()
The rule tells make both what and how to make a file
The .c suffix extension causes the C compiler to be invoked.
The .o suffix represents a object file.
The .h suffix represents a header file.
The g++ is a compiler, and not a preprocessor.
The g++ builds object code from your C++ program source.
The –c option, compiles source to object code.
The –o option, compiles object code.

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

What are the two parts of a dependency rule?

A

1) What files a file is dependent on?
2) Rule that tells how to recompile the file
What are the differences between a makefile and a shell script?
The rules in a makefile are executed based on dependency, and not sequential order. Scripts execute in sequential order.

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

Perl utilized C Language assignment operators

A

+= Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand
-= Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand
= Simple assignment operator, Assigns values from right side operands to left side operand
# Starts a Comment
– Auto Decrement operator decreases integer value by one
*= Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand

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

Shell Arguments
$0, $1, $2, $3 …
$#, $?, $$

A

Executing
./script.sh Hello World
Will make
$0 = script.sh
$1 = Hello
$2 = World
$# - Expands to the number of positional parameters in decimal
$? - Finds the return value of the last executed command
$$ - The process ID - NOT safe for use as temp filename

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

Perl $_, @ARGV, $, @, and %

A
$_ = default implied scalar (variable)
@ARGV = Array containing command line arguments
$ = calls an item from an array ex. print $test[0];
@ = variable prefix for an array
% = variable prefix for a hash
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Redirection (>, >)

A

> redirect standard output
& redirect standard output and std error
>& append standard output and std error
< redirect standard input

46
Q

#

A

Prefix for shell and Perl comments

47
Q

/

A

UNIX symbol representing a path separator and is the notation for root file system

48
Q

exit

A

exit 0 is a return if execution was successful

exit 1 is returned if execution fails

49
Q

return

A

command returns a value

50
Q

cat

A

Concatenate files and print on the standard output

51
Q

less

A

allows backward and forward movement in a file. Doesn’t have to read the entire input file before starting thus starts up faster than text editors ie: vi

52
Q

more

A

file perusal filter for crt viewing. page through text one screenful at a time.

53
Q

tr

A

translate or delete characters

54
Q

manual (man)

A

format and display the online manual pages

ex: man cat

55
Q

umask

A

new file’s permissions may be restricted in a specific way by applying a permissions “mask” called the umask. The umask command is used to set this mask, or to show you its current value.

56
Q

umask -S

A

Accept a symbolic representation of a mask, or return one.

57
Q

mv (used in renaming a file)

A

Move (rename) files

mv [option] … SOURCE DEST

58
Q

find

A

search for files in a directory hierarchy

59
Q

wc (option -l)

A

Prints the newline counts
ex: wc -l printnum.sh
47 printnum.sh

60
Q

ps -ef

A

to see every process on the system

61
Q

ls -l

A

List directory contents

-l use a long listing format

62
Q

ls -a

A

List directory contents and does not ignore entries starting with .

63
Q

cut (options -c and -f)

A

removes sections from each line of files

  • c select only these characters
  • f select only these fields; also print any line that contains no delimiter character, unless the -s option is specified
64
Q

make

A

GNU make utitlity to maintain groups of programs. to prepare to use make you must write a file called the makefile that describes the relationships among files in your program

65
Q

open

A

Perl pragma to set default PerlIO layers for input and output.
Searches catalog and bring file control block into memory
ex: open(MYOUTFILE, “>filename.out”);

66
Q

touch

A

change file timestamps
creates new file
ex: touch newfile.sh

67
Q

printf

A

format and print data

68
Q

grep

A

prints lines matching a pattern

global regular expression print

69
Q

unless

A

Perl equivalent to “if” statement

70
Q

chown

A

change file owner and group

71
Q

chgrp

A

change group ownership

72
Q

chmod

A

change file mode bits

ex: chmod 705 printnum.sh

73
Q

rm

A

remove files or directories

74
Q

rmdir

A

remove empty directories

75
Q

fork

A

fork syscal is a technique used to “divide” the parent process into two identical parts. After executed the created child process is an exact copy of the parent except for the return value

76
Q

exec

A

exec() syscal the new child of the parent process has a new PID while fork() function returns the child’s PID to the parent and 0 to child process

77
Q

Iterative data types (while, until, for, and foreach)

A

while loop continues a command or set of commands while a certain condition is true
for will continue to iterate until a limit is reached
until will do command waiting for a conditions to be met
foreach will apply a set of command for each item in a series

78
Q

sort

A

sort lines of text files

79
Q

$PWD

A

Parent working directory

80
Q

top

A

display Linux tasks

dynamic real-time view of a running system

81
Q

diff

A

compare files line by line

82
Q

who

A

shows who is logged in

83
Q

date

A

print or set the system date and time

84
Q

awk ‘{ print $1 } ‘

A

Prints the first fields of each record

85
Q

kill

A

terminates a process

86
Q

cp

A

Copy files and or directories

87
Q

tail

A

output the last parts of files

last 10 lines of each file

88
Q

head

A

output the first parts of files

first 10 lines of each file

89
Q

ls -i (print the index number of each file)

A

list index numbers of all files

90
Q

telinit

A
change system run level
2-5 multi-user runlevels
0 halt system
6 reboot
1 bring system down into single-user mode
91
Q

ln

A

make links between files

92
Q

ln -s

A

make soft or symbolic links instead of hard links

93
Q

echo

A

display a line of text

94
Q

Lines that include the colon :

A

Dependency lines. They specify a relationship between targets and the files on which they depend

95
Q

Most commonly used name of an object code file format

A

ELF - Executable and Linking Format

96
Q

Granting a user read permissions to directory allows the use of the cd command

A

True

97
Q

Three basic data types

A

Scalars - singular variable that represent a single value
Arrays of scalars
Hashes of scalars

98
Q

if statement format

A

if ( operand_1 operator operand_2 )

if ( this = that )

99
Q

Perl: Arithmetic and string operators

A

string operators bind as tightly as corresponding arithmetic

100
Q

Two types of Perl multi-valued variables

A

array and hash

101
Q

when creating Unix like process what are the standard input, output, and error

A

input - FD=0
output - FD=1
error - FD=2

102
Q

Fundamental user interface for Unix like operating systems

A

Shell

103
Q

Commonly used filter commands

A

cat, grep, tr, and sort

104
Q

Languages used for text processing

A

Shell and Perl

105
Q

Unix systems use one method for file access based on __?

A

Permissions

106
Q

Model that represents the different UNIX-like operating system layers

A

Concentric circle relationship model

107
Q

When a UNIX child process is created, it inherits a basic image of the parent. That basic image includes ___?

A

standard output, standard input, and standard error, terminal type, and home directory

108
Q

Commonly used shell programs

A

Bourne, C, and Korn shell

109
Q

A directory is…

A

a binary file that contains a list of other files and directories

110
Q

Each UNIX process (except perhaps a daemon) should expect to have three standard POSIX file descriptors, corresponding to the three standard streams

A

stdin, stdout, and stderr