======Data Structures Journal======
===August, 28 2013===
Today began the semester for Data Structures.
===August, 29 2013===
Today, we played around with pointers in order to describe pointers various effects on memory.
#include
The result of compiling and running this program gives us the following:
the first segment:
[a] address is : 0x9834985C
[a] contains: 12
[b] address is : 0x98349850
[b] contains: 0x9834985C
[b] dereferences to: 12
the second segment:
[a] address is : 0x9834985C
[a] contains: 137
[b] address is : 0x98349850
[b] contains: 0x9834985C
[b] dereferences to: 137
the third segment:
[a] address is : 0x9834985C
[a] contains: 2600
[b] address is : 0x98349850
[b] contains: 0x9834985C
[b] dereferences to: 2600
This example is perhaps the most surprising. We can see here that 'a' now has the value of 2600; the very same value as directly associated with *b. This works because *b points to the address of a.
===August 30, 2013===
Today we created a program that would list the size in bytes, as well as the maximum and minimum values of various data types. This is useful because depending on the system you are using, this could change.
The code is as follow:
#include
We can determine the size of a data type by using 'sizeof'
===September 4, 2013===
We began our journey into linked lists today. The definition of a linked list is essentially a data structure consisting of nodes. Where in each node contains a value and a "//link//" to the next node in the sequence.\\
The code to create a linked list //n// nodes long is as follows:
struct node{
int value;
struct node *next;
};
typedef struct node Node;
int main(){
int input=0;
Node *list, *temp;
list=temp=NULL;
while(input!=-1){
printf("Enter a value (-1 to end): ");
scanf("%d", &input);
if(input != -1){
if(list == NULL){
list=temp=(Node*)malloc(sizeof(Node));
temp-> next=NULL;
list-> value=input;
}
else{
temp->next=(Node*)malloc(sizeof(Node));
temp->next->next=NULL;
temp->next->value=input;
temp=temp->next;
}
}
}
temp=list;
while(temp!=NULL){
printf("%d->", temp->value);
temp=temp->next;
}
printf("NULL\n");
return(0);
}
When this code is compiled and ran, the user will be asked to input a value. As long as the user does not utilize -1 as the input, this will loop indefinitely. Every time the user enters a value, this value will be attributed to a newly created node. Once -1 is used as input, this loop ends and begins displaying the list.
===September 5, 2013===
Continuing our work with linked lists. We have derived the code to insert a node before a specified node, The code for which is as follows:
printf("Which node would you like to insert before? ");
scanf("%d", &input);
temp=list;
for(seeker=0;seeker<(input-1);seeker++){
temp=temp->next;
}
printf("Enter a value to insert: ");
scanf("%d", &input);
temp2=(Node*)malloc(sizeof(Node));
temp2->value=input;
temp2->next=temp->next;
temp->next=temp2;
===September 13, 2013===
We have constructed a working linkedlist that will build a list, display the list, insert a node into the list, append a node into the list, and remove a node from the list. The code for this is as follow. it's hefty.
#include
This runs through in a continuous fashion. The code to display the list is inserted between every list operation, such as appending and removing. This is certainly inefficient and we have been tasked with creating a menu driven list building program. This will require all of the above code to be broken up into functions, which adds another level of challenge.
===September 18, 2013===
I have successfully de-constructed the linked list code and reordered it into functions that are ran selectively from a menu in the main function. The code for which is below:
#include
This was challenging because it really did constitute the first time that i had to take a lengthy body of code and form it into functions that interacted well with each other. Luckily, Each function accepted the same thing and return the same thing, being 'list' in this case. My clear and sort functions still are not implemented as of yet.
===September 19, 2013===
Today we derived the code to make an insert function for our still-in-progress doubly linked list.
List *insert(List *myList, Node *place, Node *newNode){
if(place==myList->start){
newNode->next=place;
place->prev=newNode;
newNode->prev=NULL;
myList->start=newNode;
}
else{
newNode->next=place;
place->prev->next=newNode;
newNode->prev=place->prev;
place->prev=newNode;
}
return(myList);
}
This function will place a new node with its ->next pointing to place (place being the user specified node to insert before) and its previous points to the previous of 'place', then place->prev is directed to point to the new node.
===September 20, 2013===
Today we derived the code to remove a node, function named getNode. The code is as follows.
List *getNode(List *myList, Node **place){
if(myList->start->next==NULL){
myList-start=NULL;
}
else if(*place==myList->start){
myList->start=myList->start->next;
myList->start->prev=NULL;
(*place)->next=NULL;
}
else if(*place==myList->end){
myList->end=myList->end->prev;
myList->end->next=NULL;
(*place)->prev=NULL;
}
else{
(*place)->prev->next=(*place)->next;
(*place)->next->prev=(*place)->prev;
(*place)->prev=(*place)->next=NULL;
}
return(myList);
}
This function will allow us to remove a node. More than removing it, we will be able to use this function to remove a node and use the insert function to place it elsewhere.
===September 21, 2013===
This morning I had thought that I had stumbled upon an epiphany with the sort function in our single linked list. Unfortunately it behaves bizarrely, but I guess it's a start.
Node *sortlist(Node *list){
Node*temp;
Node*temp2;
temp=temp2=list;
while(temp->next != NULL){
if(temp->next->value < temp->value){
temp->next->value = temp2->value;
temp->value = temp2->next->value;
temp=temp->next;
list=temp;
}
}
return(list);
}
Hey... I guess documenting failure is also part of the process, right?
===September 25, 2013===
Today we broke up our program into multiple files. The embodiment of the #includes, the #defines, and the function prototypes were place into a header file. The body of main and the function definitions were separated into their own files with the header file #included in them. These were them compiled together. This is useful because it allows for function use that is not dependent on the program itself, this is important for building ever more useful libraries.
===September 26, 2013===
Today I successfully (FINALLY) took user input out of the insert function and now have the main function taking user input and passing it to the insert function. Today was a good day, even if I still feel that there is water in my lungs.
**UPDATE:** So, now I have the create list, display list (forward and back), insert, and the append function working correctly on the doubly linked list. I am nearly there on the remove function. That double pointer is really throwing me off. It's not compiling, and as is usually the case, the compiler error is just a tad too vague. I had hopes of having my doubly linked list being up to snuff before Friday. I'm relatively confident that it will not be.
===September 27, 2013===
Whelp, I now have a fully functional doubly linked list...fully functional if you accept the fact that I have yet to implement the sort or clear function. The doubly linked list is broken into separate files with a header and compiled together. So, yeah... good stuff.
===October 2, 2013===
Today we took a knowledge assessment, it was pretty terrible. After class was over I had to eat like 4 large pizzas to make myself feel better.
===October 4, 2013===
We collectively did poorly on the assessment, so, Mr. Haas reviewed with us briefly and we did it again. Thankfully, the second attempt turned out much better.
We also did the second portion of the knowledge assessment, this actually went fine.
===October 16, 2013===
A lot has happened... We are moving beyond our double linked list assembly and transitioning into stacks. This creates a new ceiling of complexity. Much in the same way that our doubly linked list manipulated nodes, our stack manipulates lists.
===October 17, 2013===
We now have a shiny Makefile to make use of for our list/stack. I was able to implant the relevant code for our doubly linked list, however I am having issues compiling the stack.
===October 25, 2013===
Stacktest now correctly works after adding a few more conditions within my function bodies. With the success of stacktest, I can only assume that my functions are all green-lit. I suppose it is now time to make my FORTY THIEVES CARD GAME. (all caps is used for dramatic effect)
===October 30, 2013===
Today we begin talking about binary trees. There are three methods of traversal in a binary tree; pre order, in order, post order. These three traversal methods dictate how the data will be ordered once the tree is finished. pre order = polish notation. post order = reverse polish notation. KNOWLEDGE. We can make certain assumptions of the binary tree, interestingly. The left most node will always be the smallest value, conversely, the right most node will always be the greatest value.
===Nov 7, 2013===
Binary tree has begun. It is currently failing, however.
We need to make an iterative based, stack based, and recursive based transversal of our binary tree. I am currently working on setting up the tree.
===Nov 8, 2013===
Losing sleep over binary tree. So simple conceptually, having trouble with implementation. Thinking about turning to hardcore drugs to alleviate my woes.
======UNIX/Linux Fundamentals Journal======
===August, 28 2013===
Today began the semester for Unix/Linux.
We briefly discussed a series of commands to use within the terminal.
who : displays the list of users currently signed into lab46, along with the time that they logged in and the amount of time a user has been idle.\\
w : a slightly different list of current users, similar to to the 'who' command. Also shows what the user is currently doing.\\
pwd : shows your absolute path, where you are currently working.\\
cd "directory" : changes your working directory to the specified directory.\\
cd : changes your working directory to the home directory.\\
man "command" : displays a manual giving various uses and modifiers of the specified command.\\
ls -l : a more detailed file list of your working directory.\\
whereis "command" : shows the path listing of the specified command.\\
whoami : Displays the current user signed in.\\
pom : displays the current phase of the moon.\\
cal : displays a calendar.\\
date : displays a date.\\
===August 30, 2013===
Today we discussed the early philosophy of Unix.\\
1). **Small is beautiful.** The meaning behind this is pretty simply to avoid unnecessary or ineffective features. This may seem to be a reduction of user-friendly features, but one could argue that with a slim design there would be fewer extraneous features to confound the user.
2). **Do one thing and do that one thing extremely well.** This could be summed up with the example that the command 'ls' lists files and certain attributes. It lists files, and it only lists files. The move command 'mv' is used to move files and can be used to rename a file. This is all it does.
3). **Everything is a file.** This, as far as I am aware, refers even to hardware, which is considered a "file". If you plug in an external hard drive, that hard drive is mounted as a file. Even your monitor is a file.
We talked about I/O streams:\\
0 STDIN\\
1 STDOUT\\
2 STDERR\\
It is possible to redirect the I/O streams to specified locations. For example we can type:
echo "gumby" > emptyfile
Instead of "gumby" being displayed to our monitor, which is where stdout would normally flow to, it is instead fed into the file 'emptyfile'. Then, if we were to examine the contents of 'emptyfile' we would see that it now contains "gumby".
'>' redirect STDOUT (write)\\
'>>' redirect STDOUT (append)\\
'2>' redirect STDERR (write)\\
'2>>' redirect STDERR (append)\\
Were we to redirect STDOUT using '>', we would be writing over any existing content. If, instead, we used '>>' we would be redirecting STDOUT to append to the destination. This would add the redirected material to the destination without writing over its previous contents.
Some more commands we learned are:\\
cp - copies specified file to specified location.\\
mv - moves specified file to specified location, also used to rename a file.\\
ln or 'ln -s' - allows us to link two files. when no modifier is used, the two linked files will have their contents mirrored. when the modifier -s is used, the link is symbolic, this does not mirror contents but can be used to make a short cut of sorts for a file.\\
rm -i or rm -f interactive or force, allows you to remove files, the modifier -i asks you if you're sure you want to remove a file before the removal occurs.
===September 1, 2013===
While not explicitly a part of the class; I wanted to get some code off of my Discrete directory but I was at home. Using putty to view and retype all the code on my computer locally would have worked, but I didn't want to do this. I used putty to access lab46, then used alpine, then created an email and fumbled around until I figured out how to attach a file. I then emailed this to my home email account, thus I did not need to retype the code.
===September 4, 2013===
Today we discussed a few different concept. The '$' symbol generally stands for variable expansion and all caps variables are called environment variables. We can define variables too, for example: stuff = "things" defines a variable named stuff. Were we to type 'echo $stuff' then the variable expansion of stuff, which in this case is "things" would be displayed to STDOUT. These local variables are stored in memory. when you log out or make a new session terminal, the variable defined as 'stuff' no longer has meaning.\\
absolute path refers to the complete path beginning at root. Your relative path is based on your current location. For example, if you were located in the src directory and had a subdirectory called 'blarg', typing 'cd blarg' would move your working directory to 'blarg'. If you were not currently located in the src directory, typing 'cd blarg' would not work because 'cd blarg' is a relative path.\\
Files that start with '.' are listed as hidden and you cannot see them be default. 'ls -a' shows all files, including hidden ones.\\
We also talked about file permissions. typing 'ls-l' will display permissions for the various files in the directory. For example: rwxr-xr-x gives read/write/execute rights to the owner, read/execute rights to the group, and read/execute rights to global. Permissions can be viewed as an octal number where each octet refers to owner or group or global. the owner having rwx privileges would be equivalent to 7. The group category having only read and execute privileges would be 5, and same for global with the same permission set. Essentially this gives us the octal of rwxr-xr-x as 755.\\
Using the '|' command can be used to join commands together. An example: "ls -l | less" joins "ls -l" with "less"\\
===September 6, 2013===
WILD CARDS!\\
//WILD CARDS!//\\
**WILD CARDS!**\\
//**WILD CARDS!**//\\
Today we discussed at great length the use of wild cards. Wild cards are characters with special meaning that will allow us to accomplish tasks more efficiently within a unix/linux based system.\\
There are at least 4 wildcards that we used in class:\\
'*' - The star wildcard allows us to search for 0 or more of anything within a search field.\\
'?' - The question mark wildcard matches 1 character length of any character.\\
'[]' - Bracket wildcard will match any of the specified character class.\\
'[^]' - Inverted character class wildcard will exclude any of the specified character classes.\\
An example of using the wildcards:\\
ls ?[e][^x]*
This will filter the results of the ls command to only display files that have a file name where 'e' is the second character of the filename, and where 'x' cannot be the third character of the file name. The subsequent '*' wildcard also lists any files that meet the previous requirements and are longer in filename.
===September 7, 2013===
Case Study ox1: Archive handling
Exercise:\\
I copied archive1.tar.gz and archive2.zip to my home directory by using the following while in the archives directory:\\ cp [a]* /home/jvanzil4|ls -l /home/jvanzil4
\\
I extracted archive1.tar.gz with the following command:\\
tar -xfv archive1.tar.gz
\\
I extracted archive2.zip with the following command:\\
unzip archive2.zip
\\
After renaming abc.txt to def.text, I used the following command to create an archive of the extracted files:\\
tar -cfv arc.tar archives
\\
Now that arc.tar exists, we can compress it using gzip. The command for that operation is as follows:
gzip -9v arc.tar
\\
the modifier of '9' refers to the level of compression, where 9 would be the most compression. now that we have a compressed archive named arc.tar.gz, we will move it to my unix directory.
===September 13, 2013===
Added Jonathan Swift's A Modest Proposal to my .plan file.
===September 18, 2013===
Today we discussed a great many things, notably we discussed multiple variations of the kill command.
We also discussed some commands bound to keys on the keyboard. For example, pressing control+c actually issues a "signal interrupt" to what ever process is running in the foreground. Control+d is bound to the EoF (end of file) command. This end of file command is interesting because on a linux/unix system nearly everything is considered a file. So, naturally executing an end-of-file will terminate many processes currently in the foreground. Control+z executes a signal suspend. This is notable because it does not terminate a process, it merely "pauses" it until it is told to resume.
typing "jobs" can show us a list of running or stopped processes. Along with the listed jobs, we are also shown a job ID, using 'bg' for background or 'fg' for foreground, along with the listed jobID, we can individually order certain processes to run in the background or foreground. One caveat is that for a prcoess to run in the background it cannot use any sort of user input for its functionality.
The command whowatch gives us a detailed look at running processes, and to which user those processes belong.
the command 'kill -l' will give us every single different sort of kill signal there is, of which there are 64. Some kill commands will close up subsequent child processes spawned by the parent to be killed. This is not true for kill -9. It is jokingly referred to as the ultimate kill command, it will not close or cleanly end children processes. Kill -9 can potentially create "zombies", which are processes for which there is no parent in governance.
===September 20, 2013===
Case Study 0x1
After unpacking badname.tgz there are now three new subdirectories. Entitled: Challenge, Example, Exercise.
Within the Example subdirectory there is a file with spaces in its name. The contents of that file are "This file has just spaces in its name."
Exercise:
Using the '*' wild card I used 'cat' to open three files. The three commands I used were:\\
lab46:~/badname/exercise$ cat just*\\
contents: "Simple, but simpler without the spaces!"\\
lab46:~/badname/exercise$ cat '#'*\\
contents: laLAA... pretend this is a pico temp file.\\
lab46:~/badname/exercise$ cat one*\\
contents: spaces, commas, two types of quotes... oh my!\\
Using the '\' wild card I used 'cat' to open three files. The three commands I used were:\\
lab46:~/badname/exercise$ cat \?\?\?\ c*\\
contents: This file has spaces and ?'s in its name.\\
lab46:~/badname/exercise$ cat \$USER*\\
contents: Watch out for those $ signs\\
lab46:~/badname/exercise$ cat \*\*\*\ w*\\
contents: Care must be taken when using the '!' symbol, as it deals with history.\\
using the " or ' shell quoting I used to 'cat' to access three files. The three commands I used were:\\
lab46:~/badname/exercise$ cat "change my\ name.file"\\
contents: This file has spaces and a backslash in its name.\\
lab46:~/badname/exercise$ cat "( parenthesis & other odd things )"\\
contents: Are we having fun yet?\\
lab46:~/badname/exercise$ cat 'compress "this" file.data'\\
contents: this file has spaces and double quotes in its name.\\
What was interesting about this last one is that I had to use single quotes or else the shell was getting confused, as there were already double quotes in the file name.
Deleting the file in the challenge sub directory was difficult. It thwarted most of my attempts.
surprisingly, when i failed to remove the file for the tenth time, I sat there, then I noticed that the terminal was telling me the answer:\\
\\
echo "please enter the year of your birth.";
read birthyear;
echo "You entered the year: `echo $birthyear`";
let age=`date +%Y`-$birthyear;
echo "You are `echo $age` years old";
3e) It selected a pseudo random number between 0 and 22.
3f)#!/bin/bash
pick=$((RANDOM % 20));
echo "Guess a number between 1 and 20.";
read guess;
let win=0;
for((chance=0;chance<3;chance++));do
if [ "$pick" -eq "$guess" ]; then
if win=0; then
echo "Hurray you disgusting wizard, the number was: $pick and you guessed: $guess.";
let win=win+1;
fi
else
echo "Sorry, you guessed $guess, that is incorrect. ";
echo "Please select a new number.";
read guess;
fi
done
if [ "$pick" -ne "$guess" ]; then
echo "You have eliminated your chances. The number was $pick, you piece of shit.";
fi
4b)
for((i=20; i>=2; i-2)); do
echo "$i"
done
5b) blue
5d) echo -n "First color is: "
let i=1;
for color in red orange yellow green blue indigo violet; do
let i=i+1;
echo "$color"
if [ $i -ne 7 ]; then
echo -n "Next color is: "
else
echo -n "The last color is :"
fi
done
Histogram script:
#!/bin/bash
#
#
if [ -z "$1" ]; then
echo -n "Enter a path: "
read path
chk=`ls $path 2>&1|grep 'No such file'|wc -l`
if [ "$chk" -eq 1 ]; then
path=`pwd`
fi
else
path="$1"
fi
echo $path
cd $path
max=0
for file in `ls -1d *`;do
c=`echo $file|wc -c`
let data[$c]=${data[$c]}+1
if [ "$max" -lt "$c" ]; then
max=$c
fi
done
for ((i=1;i<=$max;i++));do
#echo -n "$i:|-\/-|:"
count=${data[$i]}
printf "%2d |" $i
if [ -z "${count}" ]; then
count=0
fi
for((j=0;j<$count;j++));do
echo -n "|"
done
echo
done
===Case Study 0x6===
1c) xvda1, xvda2, xvda3 are all block files.
1d) hvc0, hvc1, hvc2 are all character files.
2a) Filesystems:
/dev/xvda1
tmpfs
udev
/dev/xvda2
nfs:/home
nfs:/lib/mail
2b) /dev/xvda1
2c) nfs:/home
2d) /dev/xvda2
2e) /dev/xvda3 houses the swap
2f) appears to be on a virtual disk
4c) permissions for my terminal are 620
4d) messaging is yes
5c) after switching mesg to 'n' the permission have changed for my tty#
5d) this changes the ability for people to message you by making your "file" unwritable to members of the group where previously the group had the ability to do so.
7c) cat /etc/motd > /dev/null
7d) /dev/null may be useful in a certain situation where you would not want certain output to go anywhere, but it has to go somewhere, perhaps /dev/null is the garbage can on output.
===Case Study 0x5===
Man, I really had fun making this. I now understand the 90's. My new homepage's URL is: http://lab46.corning-cc.edu/~jvanzil4/jonhomepage.html
===Lab 0x9===
1a) cat passwd | grep System
1b) grep filters through the output of cat and looks for "System". What ever line contains the grepped for string is returned.
2a) cat passwd | grep^[b-d][aeiou]
2b) this grep search only returns entries where the first character is b,c, or d; and the second character can only be a vowel.
2c)This could be beneficial when you already know the naming conventions used for entries or content in a file or directory. If you know more-or-less what you want then you can tailor grep to look for it exclusively.
3a) using cat passwd | grep ^[jtvJTV] returned only one match:
tss:x:104:65534::/home/tss:/bin/false
3b) incantation used : cat passwd | grep ^[r][aeiou].*[h]
only returned one match : root:x:0:0:root:/root:/bin/bash
4a) %s/centre/center/
4b) %s/CENTRE/CENTER/
4c) %s///
4d) %s/<\/b>/<\/strong>/
5a) I found it by doing a file words, it linked to a patch /etc/dictionaries-common. I then did a ls-al to find the file location that is being linked, which is in /usr/share/dict/american-english
5b) the file is made up of dictionary words.
5c) using cat american-english | wc -l I am able to see that there are 98569 entries.
6a) cat american-english | grep ^.....$ | wc -l = 6685
6b) cat american-english | grep^[jtvJTV].*$ | wc -l = 7845
6c) cat american-english | grep^[jJ].*[tT].*[vV]$ | wc -l = 0
6d) cat american-english | grep^[aeiou].*[aeiou]$ | wc -l = 1731
6e) cat american-english | grep^[jtvJTV][aeiou].*[est]$ | wc -l = 3464
6f) cat american-english | grep^[^jtvJTV].*$ | wc -l = 90723
6g) cat american-english | grep^[^t][^h]..*$ | wc -l = 90669
6h) cat american-english | grep^..[e]$ | wc -l = 72
6i) cat american-english | grep ^.*[b][o][b][^b]$ | wc -l = 4
6j) cat american-english | grep ^[b][l][u][e].*$ | wc -l = 37
6k) cat american-english | grep ^.*[^aeiouY].*$ | wc -l = 98562 but this must be wrong
6l) cat american-english | grep ^[^aeiouY].[abcd].*[aeiou]$ | wc -l = 1549
===case study 0x9===
1a) cat pelopwar.txt | grep "coast" | wc
1b) 9
1c) cat pelopwar.txt | grep "coast\>" | wc
1d) 8
1e) cat pelopwar.txt | grep "Dorian$"
1f) cat pelopwar.txt | grep "^Again"
2a) cat pelopwar.txt | egrep '^(Athens|Athenians)'
2b) cat pelopwar.txt | egrep '^(Athens|Athenians)'
2c,d) cat pelopwar.txt | egrep '(Corinth|Corinthians)$'
3b) No, fgrep does not allow for the inclusion of regular expressions
4a) last | grep ^[jtvJTV] | head -4
output is : jmendoza pts/82 pool-96-238-196- Thu Dec 12 01:08 still logged in
jmendoza pts/53 pool-96-238-196- Thu Dec 12 00:59 still logged in
jmendoza pts/30 pool-96-238-196- Thu Dec 12 00:59 still logged in
jmendoza pts/8 pool-96-238-196- Thu Dec 12 00:59 still logged in
4b) lastlog | sort | grep ^[e-g] | head -4
outpt is :
eberdani pts/63 10.100.20.29 Tue Feb 22 10:12:22 -0500 2011
efarley **Never logged in**
egarner **Never logged in**
egleason pts/50 cpe-24-94-60-90. Thu Dec 20 17:28:38 -0500 2012
===Lab 0xB===
1a)cat sample.db | grep Freshman
1b)cat sample.db | grep Freshman | sort
1d)5
2a) the result is "is"
2b) echo "hello there:this:is:a:bunch of:text." | cut -d":" -f1,6
2c) I still have a single colon
3a) Yes, the colon is gone.
3b) echo "hello there:this:is:a:bunch of:text." | cut -d":" -f1,6 | sed -e 's/t/T/g'
3c) echo "hello there:this:is:a:bunch of:text." | cut -d ":" -f1,6 | sed -e 's/[.]/*/g'
3d) hello there:text*
4a) tr "\r" "\n" < file.mac > file.unix
also.. the lawyer was hit repeatedly. By the same car. Am i right? eh? eh? And airplane food?!
4b) tr "\n" "\r\n" < readme.unix > readme.dos
4c) tr "\r\n" "\r" < dos.txt > dos.mac
5a) cat sample.db | grep ^[A-Z]
5b) cat sample.db | grep ^[A-Z] | cut -d":" -f3 | sort
5c) cat sample.db | grep [A-Z] | cut -d":" -f5 | sort | sed -e 's/*/ /g' =14
6a) cat pelopwar.txt | head -22
6b) cat pelopwar.txt | tail -4
6c) cat pelopwar.txt | head -48 | tail -16
6d) cat pelopwar.txt | tail -2 | head -4