Final Flashcards
UNIX was created in the:
UNIX was created at:
1970’s
AT&T Bell Laboratories in Murray Hill , New Jersey .
Who owns Bell labs?
Nokia
The original Unix development team included:
Ken Thompson, Dennis Ritchie and many other individuals .
Unix distinguishes itself from its predecessors as the first portable:
operating system
The Unix operating system is almost entirely written in the _________ programming language, which allows Unix to operate on numerous platforms.
C
The C programming language was also written by:
, so it should be no surprise that their Unix operating system is written in C.
Ken Thompson
And Dennis Ritchie
The AT&T UNIX operating system was originally developed to support activities within:
AT&T Bell Labs
Other organizations began developing their own Unix operating systems during:
1970’s and early 1980’s.
rise to the “Unix Wars during the late 1980s and early 1990s where multiple hardware vendors attempted to:
for Unix .
set the standard
List the 7 Unix wars vendors:
AT&T System 5 UNIX (Sys5)
University of California, Berkeley (BSD)
Microsoft (Xenix )
Sun Microsystems (SunOS / Solaris ) Hewlett-Packard (HP-UX)
IBM ( AIX)
Silicon Graphics ( IRIX)
operating system variants, which are able to run on personal computer architectures
Linux
Name 6 Linux operating system variants:
Ubuntu, Gentoo , Red Hat, Debian, CentOS, Linux Mint
Two methods to remotely acces a computer running the Unix os:
- Invoke a client communication program (e.g. PuTTY) on an Internet connected computer
- Via a dedicated “ dumb” terminal and keyboard Rarely used today
Once a connection is made with the Unix computer , you will be challenged to enter:
both a login identification (use rid) and a password
If userid /password combination is valid , you will see:
the Unix system prompt for your default Unix shell
After you initially login to your Unix account, you should:
change the password that was initially assigned to your account.
How do u change password?
Type command $passwd
enter your current password
enter your new password twice
Enter any of the three commands at the shell prompt to terminate a Unix session:
logout
exit
ctrl+d
represents the execution of a program that provides an environment which allows you to interact with the UNIX operating system .
shell session
To invoked a new shell session, simply:
enter the name of the shell to use at the current shell prompt
If you terminate the current shell session:
the previous shell resumes
If you precede the new shell with the ________ command, then all previously invoked shell sessions disappear .
exec
Ex: $exec bash
$exec /bin/bash
All OS’s implement a ____ control system, or ______________.
file
File system
Unix and most , if not all, others use a _________________________ structure .
hierarchical directory tree
Within a hierarchical directory tree structure, only two types of entities exist
( 1) Directories
(2) Files
______ are organized under Directories
Files
Unix’s tree is relatively ____________.
The top most directory is called _______
and is designated by a:
standardized
root
forward slash /
First level directories are shown below:
root
Other directories can be created and reside within existing directories under:
root /
By default/design you always log into your:
home directory or login directory.
Your home directory name will be the same as your:
Warhawks userid!
Home directory’s resides under:
/home
/home/userid
To identify your “present working directory type the command:
pwd
is a sequenceof directory names , separated by “, leading to a final directory or file.
A pathname or path
The directory you’re currently in is referred to as the:
present working director
The systems root directory is ALWAYS:
/
There are two types of paths:
Absolute
Relative
Is always referenced from the root directory
E.g. /home/jdoe/public/assignments
Absolute path
Is always referenced from the “present working directory” directory.
E.g. public /assignments
Relative path
represents the present working directory
represents the parent directory of the present working directory
represents the root directory
represents the user’s directory
.(i.e. dot)
..(i.e. double dot)
/(i.e. slash)
( i.e. tilde)
All ____________ are files but, all files are not ____________!
programs
programs
Files data ->
Programs ->
Data->
programs , etc.
executable instructions , binary images , script /macro , “ run on their own “ etc.
text , databases , graphics , audio , etc.
To determine the “type” of an unknown file, issue the command:
file
Often, we can determine the “type “ of a file by its _________ filename.extension
The part of the filename to the right of the period is called the:
extension
With respect to filenames, all alphanumeric characters are acceptable except:
@ ‘ | < > ! $ & \ / “ ? [ ] ( ) { } ^ # ;
The maximum filename length is ______________ including any extension and intervening periods
255 characters
True or false:
Unix in general is not case sensitive
False:
Unix is case sensitive
Any filename, or directory, that begins with a period (.) is called:
invisible/ hidden file
by default not be shown by a directory listing command
Hidden files
Only one file or directory can exist in a directory with a given:
Likewise , a file and a directory cannot share the same ______ in any directory
name
name
Good filename practice include:
- Use meaningful names
- Use “_” instead of spaces
- Establish your own naming convention
If a file contains text or readable data, then you can display a count of lines, words and characters in the file to standard output without editing it by issuing the command:
wc
4 Command line arguments:
c - count bytes
m - count characters
l - count lines
w - count words
If a file contains text or readable data, then you can display the entire contents of the file to standard output without editing it by issuing the command:
cat
Command line arguments:
n - line number on outputs
# - number of lines to display
c - clear standard output
i - prompt to overwrite
To display the first few lines of the file to standard output without editing , issue the command:
head
To display the last few lines of the file to standard output without editing, issue the command:
tail
To display the entire contents of the file to standard output page by page and without editing, issue the command at the shell prompt:
more
While the more program executes, you can issue several single character commands to interact with the program:
q - Quit
f- Move forward through the file Spacebar - move forward through the file .
b - Move backward through the file
To copy the contents of a source file to a destination file in the present working directory, issue the command:
cp
To copy the contents of a source file to a a new directory where the new file has a new name, issue the following cp command at the shell prompt:
cp [-i] srcFile path/destFile
If the destination file does not exist:
If the destination files exists:
a new file is created
then the prior file contents are overwritten
To rename a file in the present working directory issue the following command at the shell prompt:
mv [-i] srcFile destFile
To move a file from its present working directory to a new directory issue the following mv command at the shell prompt:
mv [-i] srcFile path
To move a file from its present working directory to a new directory AND rename the file, issue the following mv command at the shell prompt:
mv [-i] srcFile path/destFile
To delete a file in the present working directory, issue the following rm command at the shell prompt:
rm [-i] name
To delete a file in any directory, issue the following rm command at the shell prompt:
rm [-i] path / name
To list the files and directories under the present working directory” type the (list) command at the shell prompt:
ls
If no command line argument, then the ls command lists:
all files and directories under the present working directory.
4 Directory listing:
ls - command line arguments
a - lists all files including hidden
l - long form indicates types, permissions, links, owner, size, create time
d - list information about directory
To change to a new present working directory , issue the command:
cd
5 various cd commands:
cd path/name
cd ..
cd ../..
cd ~
cd
To create a new directory under any directory, issue the command:
mkdir
If no path (absolute or relative) is specified, then the directory is:
created in the present working directory
Creating directories:
m -
p -
m- set access(permission) mode
by default media creates the name directory in mode 777
p- create entire path
To copy an existing directory under any directory, issue the command:
cp
To use cp command you must have permission to access ________ and you the permission write in ________
nameSrc
dirDest
To delete an existing directory under any directory, issue the command:
rmdir
By default, before you delete a directory:
it must first be empty! No files or other directories in it!
You can recursively delete a directory, including its files and subdirectories, by issuing the following version of the rmdir command:
rmdir -rf [path/] name1…[ path /] nameN
The following version of the rmdir command asks you (i.e. interactive ) whether you really want to remove a file or subdirectory during recursive mode:
rmdir -ri [path/] name1… [path/] nameN
The problem with the previously discussed file commands is that your are required to type filenames exactly
E.g. If you wanted to delete 100 files, then you must do one of the following:
Execute 100 rm commands each with a single filename
Execute 1 rm command with 100 filenames
will match any string characters.
wild card *
ls t*
rm a*c
rm *
lists all file that begin with a ‘t’ in the present working directory
removes all files that begin with ‘a’ and end in ‘c’
removes all files in the present working directory
will work with any command line program, its part of the shell, not a particular program like or rm.
The wild card
To obtain more information about any Unix command, issue the command:
man
What if you don’t know the name of a command but have an idea of the function it performs?
This command will query a system database using a keyword to identify an appropriate command .
apropos
To clear standard output of all text, issue this command:
clear
PHP is the:
PHP hypertext processor
PHP was developed by:
When:
Rasmus Lerdorf (Apache group/ written in PERL)
In 1995
PHP predecessor was:
PHP/IF
(Personal home page/ forms interpreter)
PHP is primary use is for:
server-side scripting
PHP scripts can be embedded within:
html documents
How does PHP work:
The server processes the html document
executing the PHP segments
substituting the output within the html document
specifies a document at a specific web address (URL) that is desired
client
If the document is ______ or _____, then the server simply forwards it back to the client
The document is then rendered in the:
.html
.txt
client’s browser
if the requested HTML doc has embedded PHP or the file is a *.php file, the server:
executes the PHP, replacing the PHP code with its output in the document
The last step of PHP is that the modified HTML document is then sent to the:
Client
Will the web client ever actually see PHP code?
NO
The server may access files whose names ________________, or preprocessing data that it does not want the client to see
should not be seen
The only reason the client even knows PHP is involved is due:
to the file extension .php, but even this is not required if the server is configured correctly
PHP, like JavaScript , is a:
fully functional programming language
PHP has an incredible number of built-in features , including:
-Forms processing
-Output / generate various types of data ( not just text)
-Database access
-Object-oriented features
Within an HTML document or PHP document, the “<?php” until “?>”part is called:
We can call any part of the file between “<?php” and “?>” the:
processing instruction
PHP portion
All PHP programs have access to a large number of:
predefined variables
These variables allow the script access to server information, form parameters environment information, etc
Predefined variables
- An array containing much information about the server
- An array containing variables passed to a script via HTTP POST
- An array containing cookies
$_SERVER
$ POST
$_COOKIE
is a PHP built in function that returns information about the PHP server, including information about the predefined variables
phpinfo();
All PHP statements must be followed by a:
semicolon
There are three styles of comments in a PHP program:
the rest of a line is a comment
// the rest of the line is a comment
/* this is a comment * /
PHP provides two language constructs to output to the screen:
- print()
- echo()
For print and echo the ___ can be omitted
Both prints out it’s argument which is a:
()
String
What is the difference between echo and print?
echo has been shown to execute slightly faster than print
There exist four commonly used PHP scalars (data types ):
- Boolean
- Integer
- Float
- String
Could call it a double since we don’t declare variables, this works:
Float
Double quoted allows for more escape sequences and allows variables to be:
interpolated into the string
What does “interpolated into the string” mean?
rather than outputting the name of the variable, we output its contents
All PHP variables names begin with:
After that, variable names can begin with:
Otherwise rules are similar to most other languages
$
underscore
PHP Variables
Variables are:
No type:
Variables are _________ or __________
Type information is obtained from the:
dynamically typed
declarations
BOUND or UNBOUND
current bound value
Division (/) in PHP is always floating point division! To get integer division , we must:
cast to int
The inequality operators(>=, <=)do not compare strings. Instead, they will cast strings into __________ before comparing
To compare strings , use the C-like string comparison function:
numbers
strcmp()
Comparing a string and an int
Any non-numeric PHP string value will equal:
Any numeric PHP string will equal:
0
the number it represents
Comparing a string and a Boolean
A regular PHP string value will “equal”:
“0” string will equal:
true
false
PHP allows for an alternative syntax to designate a block in the:
if,
while ,
for
and switch statements
is a set of protocols implemented by Web servers that interact with web browsers
Common Gateway Interface (CGI)
is used to allow data transfer between the client and the server
CGI
Two best known CGI methods:
- GET
- POST
Appends the user’s input to URL And the server parses the URL
GET
Sends data as a stream to action program. Is more suitable for large amounts of data. Arguments are not shown in URL address
POST
GET and POST are both used within _______ forms
The user enters data into the form and then _________ the form
HTML
Submits
When forms are submitted, the server executes the _________, returning the resulting _______
PHP script
html
Servers can be set so that the form variables can be accessed directly by simply using the:
$ sign
While using the $ sign would suffice it is better to access the variables from the _______ array or the _______ array
$_POST
$_GET
We can also use PHP to create _______. However, it is really just HTML that we are creating.
forms
What is XML?
When was it developed?
eXtensible Markup Language that is a simplified version of SGML
1990s
What is the current standard of XML?
W3 consortium
SGML and XML are similar but there are a few differences:
XML is widely used
SGML is not so widely used
XML was designed to __________ data and to focus on what data ___
XML is about ___________ data!
XML is __________!!!
describe/is
describing
passive
HTML was designed to ________ data and to focus on how data _______
HTML is about ____________ data!
HTML is ________!!!
display/looks
displaying
active
XML _______ designed to describe data!
XML ________designed to display data!
XML ________ a replacement for HTML!
was
was not
is not
5 reasons to use XML:
- Separates data from display
- A means to store and exchange data between applications
- Repurpose data in multiple formats
- Create new markup languages
- Validate document content
XML is designed to be a __________ way to ___________________ between applications or store information
portable
exchange information
XML provides the means to create _________________ that you will use to move data between the applications you create
containers (i.e. files)
Is a direct derivation of XML
XHTML
For all XML applications, the __________ data will be stored in a database.
Original
Other markup languages are also XML derivations such as:
Bioinformatics Sequence Markup Language(BSML)
Mathematical Markup Language(MathML)
Chemistry Markup Language CML
A generic tool known as an ___________ can validate that documents (“instances) contain what they are supposed to contain.
XML parser
There are now many XML “spin-off standards
___________for defining the contents of XML documents exactly
___________for style sheets and transformation
XML Schema
XSLT
XML is a _____________, which allows you to describe a set of “ elements “ ( i.e. tags or markers ) in a textual document to give it a structure that can be “ processed “
meta-language
XML elements have the following structures:
<element> content </element>
OR
<emptyElement></emptyElement>
XML can refer to TWO types of files, both of which describe the “element” set (i.e. the structure ) of an XML document:
- Document Type Definition (DTD)
- XML Schema
Element __________ can include other elements
content
All XML documents (“XML instances”) contain one:
top-level element
Recall the ________ is top-level element in all HTML documents
<html>
</html>
An element can have many attributes, and they can be __________ or __________
Element names and attribute names are:
required or optional
case-sensitive
You could choose to define the header using XML attributes instead of an:
This choice is made when designing the XML document type, and is typically driven by considerations of how the data will be:
sub-elements
processed
An XML document is said to be ___________ if it conforms to the seven rules shown on the next slides
well- formed
An XML document is said to be valid if it is ____________ AND __________ to the user-defined content rules in a Document Type Definition or XML Schema
well-formed
conforms
defines the allowable elements for an XML document:
provide functionality similarly, but is more powerful:
Document Type Definition (DTD)
XML Schema
Valid implies:
XML document can be _________, yet not valid
Well-formed
Well-formed
Can an XML instance contain elements from two or more XML documents definitions?
Yes !!!
However, we need to address the issue of XML namespaces to make sure element name conflicts do not occur
What is the solution to element name conflicts?
Solution: Name Prefix
Preceded each “conflict” element name with a name prefix
namePrefix:elementName
if you use name prefixes, you must also define a __________ for each name prefixes you use
namespace
xmlns:namePrefix=“URI”
defines the location of an XML document definition
namespace
The Uniform Resource Identifier (URI) can be one of the following:
Uniform Resource Name (URN)
Uniform Resource Locator (URL)
allow you use elements from two or more XML document definitions, and avoid element name conflicts
XML namespaces
used to define DTD elements:
used to defined DT element attributes:
<!ELEMENT …>
<!ATTLIST …>
means the string of character data is passed by the parser to an application unmodified
CDATA
means the string of character data may contain parsed character data; E.g. <, >, &
PCDATA
specifies the element attribute is optional
specifies the element attribute is required
IMPLIED
specifies the element attribute (if present) must have the given this value
If the element attribute is not present, this value will be used.
FIXED