Midterm Exam Flashcards
(110 cards)
Operating System
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.
Standard input - (stdin)
output - (stdout)
error - (stderr)
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).
What is a unary operator?
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.
File descriptors (FD) (integral values)
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.
Dependency line
a line with a colon (:)
Data structure
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
umask file and directory base permissions
666 = default file permission setting 777 = default directory permission setting
Perl data types
singular, array, and hash
Perl utilizes dynamic data typing
in a dynamically typed language, every variable name is (unless it is null) bound only to an object
Perl relational operators (string, and numeric)
Numeric String Meaning > gt Greater than >= ge Greater than or equal < lt Less than <= le Less than or equal
Perl Equality operators (string, and numeric)
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
Interpolation
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)
Single back tick (
) quotes
Used for command substitution.
Example: echo The date is date
(interpolation)
Single quotes
‘ ’ - 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.
Double quotes
“ “ - Double quotes. Removes special meaning of all enclosed characters, except $, `, “, and .
Example: print “The price is $Price.\n”; (interpolation)
Regular Expression
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.
makefile
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.
Inode attributes
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).
Inode number
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
link
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
process
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.
daemon
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.
zombie
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.
orphan
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