Midterm Exam Flashcards

(110 cards)

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
filehandle
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);
26
pipe symbol
| Users can connect the standard output of one command into the standard input of another command by using the pipeline operator (|).
27
interactive process
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.
28
ANSI
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.
29
CLI (first generation) and GUI (second generation)
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.
30
Absolute (full) and relative (directory relative to another path) paths
A pathname starting with a slash is called an absolute pathname, since it always starts at the ROOT. All other pathnames (with no leading slash) are called relative pathnames. These relative pathnames are evaluated relative to the current working directory. Relative pathnames (no leading slash) always start in the current directory, not in the ROOT directory.
31
PATH
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:.
32
TERM
holds the name of the current terminal type.
33
HOME
variable points to your home directory.
34
All variables (with their associated values) known to a command at execution time constitute its environment.
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.
35
/tmp
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.
36
/bin
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.
37
/etc
contains the configuration files for the system.
38
/proc
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.
39
/dev
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.
40
makefile
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.
41
What are the two parts of a dependency rule?
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.
42
Perl utilized C Language assignment operators
+= 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
43
Shell Arguments $0, $1, $2, $3 ... $#, $?, $$
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
44
Perl $_, @ARGV, $, @, and %
``` $_ = 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 ```
45
Redirection (>, >)
> redirect standard output >& redirect standard output and std error >>& append standard output and std error < redirect standard input
46
#
Prefix for shell and Perl comments
47
/
UNIX symbol representing a path separator and is the notation for root file system
48
exit
exit 0 is a return if execution was successful | exit 1 is returned if execution fails
49
return
command returns a value
50
cat
Concatenate files and print on the standard output
51
less
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
more
file perusal filter for crt viewing. page through text one screenful at a time.
53
tr
translate or delete characters
54
manual (man)
format and display the online manual pages | ex: man cat
55
umask
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
umask -S
Accept a symbolic representation of a mask, or return one.
57
mv (used in renaming a file)
Move (rename) files | mv [option] ... SOURCE DEST
58
find
search for files in a directory hierarchy
59
wc (option -l)
Prints the newline counts ex: wc -l printnum.sh 47 printnum.sh
60
ps -ef
to see every process on the system
61
ls -l
List directory contents | -l use a long listing format
62
ls -a
List directory contents and does not ignore entries starting with .
63
cut (options -c and -f)
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
make
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
open
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
touch
change file timestamps creates new file ex: touch newfile.sh
67
printf
format and print data
68
grep
prints lines matching a pattern | global regular expression print
69
unless
Perl equivalent to "if" statement
70
chown
change file owner and group
71
chgrp
change group ownership
72
chmod
change file mode bits | ex: chmod 705 printnum.sh
73
rm
remove files or directories
74
rmdir
remove empty directories
75
fork
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
exec
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
Iterative data types (while, until, for, and foreach)
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
sort
sort lines of text files
79
$PWD
Parent working directory
80
top
display Linux tasks | dynamic real-time view of a running system
81
diff
compare files line by line
82
who
shows who is logged in
83
date
print or set the system date and time
84
awk '{ print $1 } '
Prints the first fields of each record
85
kill
terminates a process
86
cp
Copy files and or directories
87
tail
output the last parts of files | last 10 lines of each file
88
head
output the first parts of files | first 10 lines of each file
89
ls -i (print the index number of each file)
list index numbers of all files
90
telinit
``` change system run level 2-5 multi-user runlevels 0 halt system 6 reboot 1 bring system down into single-user mode ```
91
ln
make links between files
92
ln -s
make soft or symbolic links instead of hard links
93
echo
display a line of text
94
Lines that include the colon :
Dependency lines. They specify a relationship between targets and the files on which they depend
95
Most commonly used name of an object code file format
ELF - Executable and Linking Format
96
Granting a user read permissions to directory allows the use of the cd command
True
97
Three basic data types
Scalars - singular variable that represent a single value Arrays of scalars Hashes of scalars
98
if statement format
if ( operand_1 operator operand_2 ) | if ( this = that )
99
Perl: Arithmetic and string operators
string operators bind as tightly as corresponding arithmetic
100
Two types of Perl multi-valued variables
array and hash
101
when creating Unix like process what are the standard input, output, and error
input - FD=0 output - FD=1 error - FD=2
102
Fundamental user interface for Unix like operating systems
Shell
103
Commonly used filter commands
cat, grep, tr, and sort
104
Languages used for text processing
Shell and Perl
105
Unix systems use one method for file access based on __?
Permissions
106
Model that represents the different UNIX-like operating system layers
Concentric circle relationship model
107
When a UNIX child process is created, it inherits a basic image of the parent. That basic image includes ___?
standard output, standard input, and standard error, terminal type, and home directory
108
Commonly used shell programs
Bourne, C, and Korn shell
109
A directory is...
a binary file that contains a list of other files and directories
110
Each UNIX process (except perhaps a daemon) should expect to have three standard POSIX file descriptors, corresponding to the three standard streams
stdin, stdout, and stderr