Free Essay

Sociology

In: Social Issues

Submitted By drmagicman
Words 5471
Pages 22
http://jozefg.ecs.fullerton.edu/public/CS906/Assignment/
|Ass # |Text Chapter |ASSIGNMENT CPSC 906 FALL 2004 |Due |Max Points |
| | |Section 1 | | |
| | |Note: Please provide the program assignment documentation according to | | |
| | |SyllabusCS901.doc and Project Submittals.doc. | | |
|1 |Ch1 |Problems: 26 p.69. Unit conversion. |09-09 |2 |
| |Ch2 |Problems: 4 p.153. Stacks separated | | |
|2 |Ch2 - 3 |See the exercise assignment description below |09-21 |3 |
| | | |Tue | |
|3 |Ch2 |Problem: 39 p.156 - provide a Gantt chart for each case and calculate AWT,| 09-30 |3 |
| | |ATT and ART. Problems 44. |Thu | |
| | |Provide the solution in the PowerPoint slides. Bring a hard and electronic| | |
| | |(floppy) copies of your solutions. | | |
|4 |Ch3 |QUEUING SYSTEM AND BATCH SCHEDULING. See the programming assignment | 11-2 |20 |
| | |description below |students | |
| | | |requested | |
|5 |Ch4 |PAGING SYSTEM. See the programming assignment description below |11-18 |20 |
|6 |Ch1-2or |Lab 1 description below |11-30 |5 |
| |Ch0 [1] | | | |
|7 |Ch2, 8 or |Lab 2 description below |12-2 |5 |
| |Ch3-5 [1] | | | |
|8 |Ch3-5 or |Lab 3 description below |12-9 |5 |
| |Ch9,12 [1] | | | |
|9 | |Extra Research Paper |12-20 |6% |
| | |See Guidelines_Research_Report.doc and |11:59 pm |or |
| | |the format in FORMAT_for_articles.doc | |0% will be |
| | |in the Guidelines folder. | |added to your|
| | | | |grade |
| | | | | |
| | | | | |

[1] Syed Mansoor Sarwar, Robert Koretsky and Syed Aqueel Sarware,
Unix: The Textbook, Second Edition, 2005, ISBN: 0-321-22731-X

Assignment 1 - solutions

Ch 1, P26. don’t send it The conversions is as follows:: (a) microyear = [pic] * 365 day/year 24 hour/day * 3600 sec/hour = 31.536 sec. (b) gigamicron = [pic] microns * [pic]meter/micron = 1000 meters = 1 km. (c) 2TB = [pic], which is 1,099,511,627,776 bytes or approximately 1 TB = [pic] (d) 6000 yottagrams = 6000 * [pic]grams = 6 * [pic] kg.

Ch 2, P4.

There are several reasons for using a separate stack for the kernel. Two of them are as follows. • First, you do not want the operating system to crash because a written user program with a poorly design recursive function does not allow for enough stack space. • Second a protection reason, if the kernel leaves stack data in a user program’s memory space upon return from a system call, a malicious user might be able to use this data to find out information about other processes.

Assignment 2

Provide the solution in the PowerPoint slides. To draw Petri Nets use Drawing available from the pop-up menu when you right click on the menu bar. Bring a hard and electronic ( floppy) copies of your solutions.

1. Show how counting semaphores (i.e. semaphores that can hold an arbitrary value) can synchronize n processes. Assume that two processes can be in the critical section at any time instant. Draw a solution using Petri Nets and describe how it works. 2. Show the generic solution to the Producers – Consumer Problem using semaphores full, empty and mutex for n producers and m consumers with b empty slots in the buffer. Provide a solution using Petri Nets. Describe how it works.

Programming Assignment 3: QUEUING SYSTEM AND BATCH SCHEDULING

Learning goals: Understanding of queuing system and batch scheduling,

Skills: Learning and/or practice of C++ object oriented programming: in particular creation and manipulation of five classes simultaneously.

Purpose: The purpose of this assignment is to design and implement a simulator of an operating system seen as a queuing system and find out which system consisting of many CPUs can satisfy the user’s average waiting time and other criteria. The simulator program has to be written in C++ programming language.

Description 1. Write a general-purpose simulation program to simulate a queuing multiprocessor system. Include the admission and CPU schedulers. The admission scheduler purpose is to check whether a job arrives, if yes put in a FIFO queue. The CPU scheduler purpose is actually picking one of the ready job from the queue. The program should calculate the performance parameters specified below.

2. The input is as follows: 1. The length of the simulation 2. # of servers (CPUs) 3. The distribution of arrival times (average time between job arrivals) 4. The maximal processing time per job

Assumptions: No more than one job arrives per time unit

3. Job (process) structure

Each job (process) may include the following fields (input and calculation attributes): pId /* process id priority /* integer state /* 0 for ready, 1 for run, 2 for blocked, 3 for terminated CPU ProcessingTime /* CPU processingTime in milliseconds CPUId /* CPU # waitTime /* in milliseconds turnaroundTtime /* in milliseconds completionTime /* in milliseconds responseTime /* in milliseconds arrivalTime /* in milliseconds deadline /* in milliseconds

4. Assumptions and rules for the simulator:

• R1: If a job arrives, it gets in queue (ready queue)

• R2. If the CPU is free and a job is waiting (state = ready), the queue is scanned by the CPU scheduler to select the job. The selected job state is changed to run and advances to the available CPU . – The service time is given for each job

• R3. If a job is at the CPU the time remaining for that job to be serviced is decremented by 1

• R4. If there are jobs in queue with state = ready, the additional second that they have remained in the queue is recorded

• R5: If a job is running it remains in the same one queue, but the state is run

• R6. A completed job is removed from the queue and the current criteria variable can be updated/accumulated (or a completed job stays in the queue with the extended process state – terminated = 3 and at the end of simulation all criteria variables are calculated)

5. Strategy. The CPU scheduler must use the following strategy Non-preemptive FIFO - First-In, First-Out

6. The following criteria must be used for the strategy evaluations 1. Average Processing Time APT = Σ PT for all jobs / n 2. Average Wait Time AWT = Σ WT for all jobs / n 3. Average Turnaround Time ATT = Σ (ET – AT) for all jobs / n 4. Average Completion Time ACT = Σ (ET) for all jobs / n 5. Average Response Time ART = Σ (ST - AT) for all jobs / n 6. throughput THR - number of completed Jobs (processed) during the simulation

• where: WT – job Wait Time, ST – job Start Time, ET – job End Time, AT – job Arrival Time • n – number of Jobs reached servers during the simulation e.g. 1, 2, 5 or - number of Jobs number of completed Jobs (processed) during the simulation e.g. 3, 4

7. The output table should include the following columns :

1. SL -Simulation Length 2. CPUs -Number of CPUs 3. MTT -Maximal Transaction Time 4. TBA- Time Between Arrivals 5. TJA - total jobs arrived 6. TJD - total jobs done (serviced) 7. APT - Average Processing Time 8. AWT - Average Wait Time 9. ATT - Average Turnaround Time 10. ACT - Average Completion Time 11. ART - Average Response Time 12. ATH – Average Throughput - number of completed job (processes) during the simulation 13. JLQ - Jobs Left unserviced in queue (you may calculate TJA / JLQ ) 14. JLS - Jobs Left unserviced in servers (you may calculate JLS / JLQ )

• Please bold the best result from 7 to 12 for each different input dataset.
Example:

SL CPUs MMT TBA TJA TJD APT AWT ATT ACT ART ATH JLQ JLS
__________________________________________________________________________
100 1 3 3 41 40 1 0 2.0 52.0 2.8 40 0 1

100 1 3 5 21 21 1 0 1.6 53.5 0.1 21 0 0

100 1 5 3 41 38 2 3 6.2 53.9 6.1 38 2 1

100 1 5 5 21 21 2 0 2.9 54.8 0.5 21 0 0

100 2 3 3 41 40 1 0 1.5 51.6 2.4 40 0 1

8. Test your project: we want to answer the question. Is one CPU enough? If it is not how many we need to handle the traffic if the job arrives e.g. every 3 units (or 5 units) and # of servers varies e.g. from 1 to 4. We have to run each set of parameters defined in the structure below for 100, 500, 1000, 5000 units:

struct ParametersType { int timeLimit; // e.g. 100, 500, 1000, 5000 int numServers ; // e.g. 1 - 4 int processingTimeMax; // e.g. 3, 5 int TimeBetween; //e.g. 3, 5 }; So there are 4 * 4 * 2 * 2 combinations. That dataset (or better yours numbers) you can treat as a default (hardcoded) and now allow the user to enter his/her own data and have the report with the user report printed.

8.1 You may provide the listing of the main variables values (job arrived, processing time etc.) for each cycles for the debugging of functionality and verification of statistical data

9. See the outline details in HomeAssig_1_Outline.ppt.

10. All assignments must follow the Project Submittals.doc, Guidelines_source.doc, Guidelines_style.doc, DiagramExamples.doc handouts.

Programming Assignment 4: PAGING SYSTEM

Learning goals: Understanding of a paging system and page replacement algorithms.

Skills: Learning and/or practice of C++ or Java or C# object oriented programming

Purpose: The purpose of this assignment is to design and implement a simulator of a paging system and its algorithms.

Description 1. Write a general-purpose simulation program to simulate a paging system. At the start of the program, the user should be asked to choose a page replacement algorithm. The input to the program is the number of page frames of the physical memory and a list of page references taken from the input file. On each cycle, read the number of the referenced page from the input file. At each page fault, a procedure should be called to choose a replacement page algorithm and calculate the distance string. The distance string should be calculated only for FIFO and LRU algorithms. Assume that the reference page happens in each clock tick. When the run is completed, the program should print the number of page faults, and corresponding distance strings. Plot the distance string, analogous to Fig. 4-26. Generate output to the screen and a listing similar to Fig. 4-25, except rotated 90 degrees so that each new page reference increase the length of the output by one line. The program should maintain the stack of pages, analogous to Fig. 4-25. Make multiple runs for different values of the memory size and draw the conclusion.

Updates are written in blue (11-9-04)

2. The input per one cycle is as follows: a. the page replacement algorithm or you can switch inside the simulator b. one set from the input file: i. an input file will have 6 sets of page references as follows: 1. three sets of 20 digit strings: a. 01723271030172327103 b. 01234501234554321054 c. 13578837123456235123 2. 3 sets of randomly-generated page references (20 number strings). The range of numbers defined by the student c. the number of page frames of the physical memory is 4 for the first three sets in i). Two more numbers are defined by the student.

3. The output: Generate output to the screen and a listing similar to Fig. 4-25, except rotated 90 degrees so that each new page reference increase the length of the output by one line. The program should maintain the stack of pages, analogous to Fig. 4-25.

4. The following criteria page replacement algorithms are used:

1. Optimal (OPT) Remove the page which is not going to be used for the longest time in the future. 2. First In First Out (FIFO) The oldest page is replaced regardless of activity. 3. Second Chance (SC) • At each page fault replace search always starts looking at the oldest page and has not been referenced in the previous clock interval. - If all pages have been referenced, replace the oldest page. 1. If R = 1, the page is put onto the end of the list (give the page a 2nd chance) and its “load time” is reset to the current and set R = 0 2. If R = 0, the page is both old and unused, so it is replaced immediately • if it was modified evicted from memory to disk, if it is clean – abandon it

• If all pages have been referenced, replacement of the oldest page will take place base on item 1 – it degenerates into pure FIFO 4. Clock • At each page fault perform the Second Chance algorithm, but begin the search where the algorithm finished the last time 1. If R = 1, the hand pointer is advanced to point to the next page and set R = 0 2. If R = 0, a page is actually replaced, the new page is inserted into the clock in its place and the hand pointer is advanced and set R = 1 3. Repeat 1, 2 until a page is found with R = 0 5. Least Recently Used (LRU) • This algorithm removes the page that has not been referenced for the longest period. 6. Working Set (WS) • Find a page which doesn’t have reference during the last tau time units and evict it. Determine tau units.

5. Test your project: First test your results for every algorithm on paper and include it in your paper work. Then make multiple program runs for 3 different values of the memory size and 6 sets of page references and 6 algorithms.

6. Draw the conclusion from your results.

UNIX ASSIGNMENTS:

Lab 1

Learning Objectives

1. To practice identifying parts of a UNIX command.

2. To identify and describe your method of connecting to a UNIX system.

3. To practice using file maintenance commands.

4. To build and manipulate simple file structures in your home directory.

5. To further examine man pages for file maintenance commands.

6. To practice using various utility commands for the beginner.

Lab Work (5 points)

Please fill out all exercises below and hand in all (text and answers) to the instructor. • Use Alt+PrntScrn to capture your screen and Ctrl+V to paste it or • Hightlight your commands in yellow and the shell answer put in another color 1. In the exercises below, what you type-in at the UNIX command line is shown in Courier font. In the following commands, identify the parts of the single UNIX command presented by printing the letters C (for Command), O (for Option), OA (for Option Argument), and CA (for Command Argument) directly over the command line, such as-

C O CA 1. $ ls -la convert.txt

2. $ more convert.txt

3. $ pwd

4. $ cat file1 file2 file3

5. $ rm -r temp

6. $ ping –c 3 cse.ogi.edu

7. $ telnet cs.berkeley.edu 13

8. $ cc -o short short.c -lbaked

9. $ chmod u+rw file1.c

10. $ uname -n

2. Log on to your UNIX system. Make an exact list of exactly what steps you employ when logging-into and out of your UNIX system, and in the list, describe each step briefly in a sentence or two.

3. After you have successfully logged-in using your method from above, in the console or terminal window, type the following UNIX commands on the command line. Note and write down the results (The command line prompt is shown as a $, which may be different on your system):

a. $ ls b. $ pwd c. $ xy d. $ cd .. e. $ pwd f. $ cd g. $ pwd h. $ cd /usr/local i. $ ls j. $ cd

4. In preparation for the following steps, create two (2) text files in your home directory on your UNIX system named 1st and 2nd, by using the cat command (see Quick_Start_into_UNIX_00.ppt)

5. You may type whatever text you want into these files, as long as it consists of printable characters that can be viewed on the UNIX command line. Also, after executing the following steps for each figure, if you delete files 1st and 2nd by mistake, then recreate them before you go on to the next figure. Using the figures found below, and the file maintenance commands covered in the textbook, create a directory and file structure under your home directory on your UNIX system exactly as shown in each figure. A directory is represented in the figures as a rectangle, and a file is represented as a circle. Then, write down a list of exactly what commands you used in sequence to create the structure for each figure. The directories and files that already exist in your home directory before you begin are irrelevant for our purposes in these exercises. In the event that directories that already exist in your home directory before you start any exercise have the same exact names as any of those shown in the figures below, then simply make up your own names for what is shown in the figures, and create the structure using your own names. Hint: You can always use the pwd and ls commands at any point in the construction process to verify the fidelity of your structure.

Once you have finished building each structure, use the appropriate file maintenance commands from the textbook to completely undo what you have done above. Then write down a list of exactly what commands you used in sequence to undo the structure for each figure. "Undo" means delete the directories and files created for that figure, except for files 1st and 2nd. The files 1st and 2nd must remain in your home directory after you have undone the directory and file structure for any particular figure, so that you can use them to create the structure for the next figure.

[pic]

6. Use the man command on your UNIX system to construct a table of one sentence long descriptions for all ten (10) file maintenance commands found the textbook. Put the Description part of the manual page that you see displayed on-screen into your own words in one-sentence format, being careful to include the most important aspect(s) of the command as you find them stated in the description.

|cat | |
|more | |
|cp | |
|mv | |
|rm | |
|ls | |
|mkdir | |
|cd | |
|pwd | |
|rmdir | |

7. After making the list of command descriptions from above, what changes would you make in the ways you constructed the file structures for the figures in the previous section?

Tip: shorten the number of commands they used above to create and undo the file structures

In preparation for the next exercises, view and make notes about the use of the lpr or lp commands on your UNIX system by viewing the man pages for those commands. Note that if your UNIX system has another print command available that your instructor recommends you use, then substitute this command, and its syntax and procedures, for the lpr or lp commands in the exercises below. For example, our UNIX system has a macro command named "print", which allows you to do the same thing as the lpr or lp commands.

8. Use the lpr or lp commands on your UNIX system to print the text files 1st and 2nd that you created with the cat command above. Specify here what did you use it?

9. Use the cat command to create a new text file named "letter", and print this new file using the lpr or lp commands at your UNIX system line printer. Specify here what did you use it?

10. Create a text file named "manual_mkdir" of the contents of the man page for the command mkdir by typing the following command on the UNIX command line: man mkdir > manual_mkdir. This command is similar to what is shown in the textbook, and is an example of output redirection; the > character redirects the output of the manual page from the man command to a file, which you have specified as manual_mkdir. Print this file to your UNIX system line printer using the lpr or lp command.

11. Depending upon the default shell that you run when you login to your UNIX system, create 6 command aliases similar to found in Quick_Start_into_UNIX_00.ppt, for your use whenever you login. Specify your list here for at least two shells.

12. Log out. Press on a new line, as in

$

Lab 2

Objectives

1. To practice a few commonly used UNIX commands.

2. To practice editing text files in vi

Lab Work (5 points)

Please answer to each exercise and hand in printouts and a floppy/CD-ROM to the instructor.

1. Log on to your UNIX system

2. Use the who command to display the names of users currently using your UNIX system.

a. How many users are currently using your UNIX system?

b. Who has been logged on for the longest period of time and for how long? Write down the time and date since when this user has been logged on.

c. Are any users logging on by using telnet? How could you tell? Write down the names of the computers from which these users are logged on.

3. Use the cal command to display the calendar for the following years: 4, 52, 1752, 1952, 2004, and 2005.

a. Write down the commands you used to display the calendar years.

b. Does the command work fine both leap and non-leap years? How could you tell?

c. How many days does the year1752 have? Are you surprised? What surprised you? Search www.google.com for “Gregorian calendar”. How many hits did Google show for your search? Read one of the top sites and write down the reason for your surprise. Why is our calendar called the Gregorian calendar? Write down the URL of the Webpage that you read for your answer.

4. Use the following commands to display information about your computer system: uname (to display the name of the operating system), uname –n (to display the domain name of your system), and uname –p (to display the name of the CPU in your system). Show your sessions in your answers.

a. What is the name of your operating system?

b. What is the domain name of your computer system?

c. What CPU is in your computer system?

5. Use the pwd command to display the name of your home directory.

a. Write down the full pathname of your home directory

6. Use www.google.com and search for the following operating systems: UNIX, LINUX, FreeBSD, NetBSD, Solaris, Windows XP, Windows 2000, Windows NT, Windows 98, Windows 95, Windows 3.1, and MacOS. Write down the names of the three most popular operating systems on the Web. Write down the number of hits found for each by www.google.com. What is the combined total for all Windows operating systems?

7. Display the message that is displayed when you log on. Hint: this message is stored in the /etc/motd file. Show your session.

8. Display the contents of the following files, if they exist on your system: /etc/profile, ~/.profile, ~/.bashrc, ~/.bash_profile, ~/.login, and ~/.cshrc. What are the values of the following shell environment variables: PATH, path, LINES, HOME, and home. If you don’t find any of these variables in the above files, use the echo $variable command to display the value of a variable, where variable may be PATH, path, LINES, HOME, or home. Show your session.

9. To find the search path your system looks at or along to determine where the default shell finds programs, type echo $PATH (if you are using the Bourne, Korn or Bash shells) or type echo $path if you are using the C shell.

No answer required. 10. Find out what shells are installed and available for your use on your UNIX system, and how to run them. See LN_04_UNIX_Shells.ppt. Use the appropriate command to run additional available shells on top of your default shell. What commands did you use to run the available shells? How can you know that the additional shells are actually running? Why would you want to run additional shells on top of your default login shell?

11. How can you terminate the shells that you started? What happens if you accidentally terminate the default login shell?

12. How do you change the default prompt for the C or TC shell for the current session only? How do you change the default prompt for the Bourne or Korn shell for the current session only? To experiment with this option, depending on the shell you are running, change its default prompt to some new character for this login session only.

13. Explain the output of the following command(s), given the shell metacharacters included on the command line-

|Command(s) |Output |
|ls ~ ; rm *.doc | |
|set prompt=`pwd` | |
|man ps > pscoms | |
|ls .*.* | |
|lpr –Pspr [0-9]*.eps | |
|csh & | |
|mv "file 1 .ps" file1.ps | |

14. Execute the vi program on a new, blank file.

a. On the first line of the file, type your first and last name.

b. On the second line of the file, type " The vi UNIX text editor has almost all the features of a word processor and tremendous flexibility in creating text files".

c. Print the file to your UNIX system line printer while you are still in vi. How do you accomplish this, in a non-X Window System environment?

15. What vi command allows you to move to the first line in the current buffer? What command allows you to move to the last line in the buffer?

16. Use the set command to force vi into a 30 column by 15 line display of characters so that one screen of the display shows only 15 lines, and text is automatically wrapped onto the next line after the 30th character. How did you do this? (Hint: The set all command shows the current status of all vi environment variables.)

17. What file in your home directory allows you to customize your vi environment variables permanently?

18. Execute all commands in Table 5.5, 5.6 and 5.7.

No answer required.

19. What do the following 8 vi commands do?

12dw Deletes twelve words, starting at the current cursor position 5dd Deletes five lines, starting at the current line 12o Opens twelve blank lines after the current line 5O Opens five blank lines before the current line c5b Changes back five words d5,12 Deletes lines five through twelve in the buffer 12G Puts the cursor on the twelfth line of the file 5yy Yanks (copies) the next (starting with the current line) five lines into a temporary buffer

20. Log out.

$

Lab 3

Learning Objectives

1. To learn how to display contents of ‘text’ files 2. To learn how to copy, append, move, and remove files 3. To learn how to combine files 4. To learn how to determine the size of a file 5. To learn how to compare ‘text’ files 6. To learn to use the various printer related commands 7. To learn how to use UNIX I/O redirection and pipe operators 8. To learn to use the I/O redirection and pipe operators to perform complex tasks which cannot be performed by individual commands 9. To learn how to use UNIX FIFOs 10. To learn how to use the UNIX I/O operators, pipes, and FIFOs to perform challenging tasks which are not possible with individual commands

Lab Work

In this lab, you will practice the basic file related commands in UNIX. For this purpose, you will make a few files and use then in this and some of the subsequent chapters.

1. Log on to your UNIX system

2. Create a few small to large size ‘text’ files for use in this and subsequent chapters. You can create a medium size ‘text’ file by executing the man cat > mediumFile command and a large size ‘text’ file by using the man bash > largeFile command. Finally, you can prepare a small size file by entering several lines of student data in a file called smallFile. A line in this file is of the following format, with fields separated by tabs:

$ man cat > mediumFile $ man bash > largeFile $ vi smallFile

3. Use the cat and nl commands to display the smallFile with line numbers. Outputs of both commands should look exactly the same. Show the commands that you used to accomplish the task.

If smallFile had blank lines, the nl smallFile command would be equivalent to the cat –b smallFile command.

4. Display the smallFile and mediumFile 18 lines at a time using the more command. Show your command; there is no need to show the output of your command.

5. You need to display the first 12 lines of largeFile and last five lines of the smallFile in the reverse order. What commands will you use? Show your session.

6. The purpose of this part of the lab is to have you appreciate the working of tail command with –f option. Make a copy of the smallFile in the file called dataFile. Then create a C program file with the following program in it. Name the file ch9.c.

#include

main() { int i;

i = 0; sleep(10); while (i < 5) { system("date"); sleep(5); i++; } while (1) { system("date"); sleep(10); }

}

Now run the following commands, in this order. The first command produces the executable code for the C program in the generate file. The second command appends the output of the date command to the contents of dataFile, initially every five seconds and then every 10 seconds. Note down the number in brackets that the system displays after you have submitted the second command to the system. The tail –f dataFile command displays the current contents of dataFile and then displays the data newly appended to dataFile.

gcc ch9.c –o generate generate >> dataFile & tail –f dataFile

After you have seen the working the tail –f command for a minute or so, terminate it with and terminate the generate command by using the kill –9 12345, where 12345 is the number that you noted down above after submitting the generate command to the system. Show your session.

7. You made a copy of the smallFile in dataFile. Use the ls –l command to see whether the modification times for the two files are the same or different. They are different; the modification time for dataFile should be the time when it was created with. What command would you use to preserve the modification time for the file? What are the inode numbers for the two files. Now move dataFile to newDataFile. What is the inode number for newDataFile? It should be the same as that of dataFile. Is it? If it is, explain why. Now move newDataFile to the /tmp directory. What is the inode number for /tmp/newDataFile? Most likely, it isn’t the same as that of newDataFile in your current directory. Why? Show your session.

8. Display the sizes of smallFile, mediumFile, largeFile, and /tmp/newDataFile in byes, words, and lines. The size of smallFile and /tmp/newDataFile should be the same. Can you use another command to show the size of the file in bytes? What is it? Show your session.

9. Print two copies of smallFile with line numbers and a header at the top. What command did you use? Could you have used another command to accomplish the same task? Show your session.

10. A program, called banner, reads input from standard input and sends its output to standard output. Run this program so that it reads input from the student.records file and sends its output to the output.data file. Error messages are appended to the error.log file. Show your session.

11. Create a file test.data using the cat command that contains the following data. Once you have created the file, display its content with the cat command. Show your session.

$ cat > test.data This data is to be stored in a file called test.data by using the cat command. We can create the test.data file with this data by using a text editor such as vi. However, the purpose of this exercise is to show an interesting use of output redirection.

12. Combine data in the following files (in this order) and append it to the all.labs file: lab1, lab2, lab3, and lab4. Any errors should be redirected to the error.log file. Show your session.

$ cat lab1 lab2 lab3 lab4 >> all.labs 2> error.log

13. The smallFile file used in Lab 10 contains student records. Use a command line to display the records for the top five students in ascending (sorted) order, i.e., with the highest GPA student’s record displayed first. Show your session.

$ sort +3 -r -b smallFile | head -5

14. Create two FIFOs, called fifo1 and fifo2. Use these FIFOs, the tee command, and I/O redirection operators to generate the following output: total number of processes running on the system, status of all daemon processes, and total number of daemons running on the system. Show your work.

15. Log out.

$

Similar Documents

Premium Essay

Sociology

...Sociology = the scientific study of society and human nature   I.  What are the two components of the sociological perspective (imagination) and why are both elements essential?              a.    b.      II. What is social location?   a.      III. What is the role of tradition vs. science in the origins of sociology and what is the scientific method?             a.               b.     IV. Who was credited as the founder of sociology?  What was he known for?               a.              b.   V. Who was known for Social Darwinism and what is it?             a.             b.      VI. How did Comte and Spencer differ?             a.      VII. Karl Marx believed that societal problems were a result of class conflict. What is class conflict? a. Class Conflict-                         i. bourgeoisie-                         ii. proletariat-   VIII. What did Max Weber believe and how did he and Marx differ?           a.   IX. Explain Emile Durkheim’s following contributions to sociology?           a. In reference to the discipline of sociology:                       b. Social facts or forces (patterns of behavior):               c. Social integration:     X.  What was the role of women in early sociology and who were the key women figures (and their contributions)?           a.             b.             c.   XI.  Explain racism in early sociology and the role of  W.E.B.Du Bois?           a.           b.       XII....

Words: 264 - Pages: 2

Premium Essay

Sociology

...Introduction to Sociology Nandy Nedd Essay Outline #1 Title: “Sociology is the systematic observation of social behavior”   Introduction: Sociology is the science of society. Body: * Science is defined as the observation, identification, description, experimental investigation, and theoretical explanation of phenomena, Sociology is a science because it uses the methodologies of observation, experiment, comparison and historical research to understand social behavior whereas Interpretive Sociology goes on assumptions about how we come to know about social phenomena. * Using the positivist approach which assumes that an objective reality exists “out there”, Sociologists study this reality without changing it any way, they strive to remain objective so that their own attitudes and beliefs do not influence their results whereas in the Interpretive approach, lived experience may be distorted by false consciousness and ideology * In A general View of Positivism, Comte (1798 – 1857) argues that “the primary object of positivism is to generalize our scientific conceptions and to systemize the art of social life,  According to him; true knowledge is based on experience of senses and can be obtained by observation and experiment, while it is for our heart to suggest our problems, it is for the intellect to solve them. * In his book “Rules of Sociological Method”, Durkheim writes –“The first and most fundamental rule is – consider social facts as things.” By...

Words: 366 - Pages: 2

Premium Essay

Sociology

...Sociology is and should be a science Karl Popper- If academic subjects want to be called a science they must undergo falsification. This means sociology would have to come up with a hypothesis; such as suicide is caused by insufficient integration and regulation. He rejects Marxism as a pseudo-science because its concepts are too abstract to be seen or measured (false class consciousness) Destructive method- Theory has loads of challenges to the hypothesis. Inductive method- Finds loads of evidence to prove self. Research process- If it should be a science it must adopt body of metholgical principles common in natural sciences: Empiricism- Must be able to prove or disprove theories with direct experience. Religion can never be proved so isn’t science. Objectivity- Conclusions should be based on available evidence and not opinions or beliefs of researcher. Controlled Experimentation- Systematic and controlled experiments where any other influence isn’t involved. Cumulative progression- Science is a march of progress, where new discoveries improve previous knowledge. Sociologists can adopt research methods that are faithful to the natural sciences, quantitative data used to reveal patterns of human behaviour, and then conclusions can be made which gives laws. Durkheim- believes sociology is the study of social acts that are external to the individuals, didn’t directly observe the social cause of suicide but did observe its effects. Not......

Words: 587 - Pages: 3

Premium Essay

Sociology

...human body, functionalists took a similar approach to understanding human social systems. Social systems were dissected into their "parts," or institutions (family, education, economy, polity, and religion), and these parts were examined to find out how they worked and their importance for the larger social system. The rationale was that if scientists could understand how institutions worked, then their performance could be optimized to create an efficient and productive society. This approach as proved to be very successful and is the predominant philosophy guiding macro-level sociology today. Structure-functionalism arose in part as a reaction to the limitations of utilitarian philosophy, where people were viewed as strictly rational, calculating entrepreneurs in a free, open, unregulated, and competitive marketplace. The tenet of functionalism, and the fundamental building block of all sociology, is that people behave differently in groups than they do as individuals. Groups have "lives of their own," so to speak. Or, as you might hear from a sociologist, "the whole is greater than the sum of its parts." Anyway, the point is, that just as the "invisible hand of order" can guide economic relations, "social forces" can guide social relations, and thus yield for society very positive outcomes (volunteerism, democracy, laws, moral and ethical standards for behavior, family and...

Words: 401 - Pages: 2

Premium Essay

Sociology

...[pic] |Syllabus College of Social Sciences SOC/120 Version 4 Introduction to Sociology | |Copyright © 2011, 2009, 2007, 2006 by University of Phoenix. All rights reserved. Course Description This course is a foundation for studies of sociology. In this course, students gain an understanding of the sociological perspective, theories, and research methods. Students also explore culture, race, ethnicity, socialization, social interaction, deviance, social control, groups, organizations, social and gender stratification, population, and social change. Policies Faculty and students/learners will be held responsible for understanding and adhering to all policies contained within the following two documents: • University policies: You must be logged into the student website to view this document. • Instructor policies: This document is posted in the Course Materials forum. University policies are subject to change. Be sure to read the policies at the beginning of each class. Policies may be slightly different depending on the modality in which you attend class. If you have recently changed modalities, read the policies governing your current class modality. Course Materials Macionis, J. J. (2011). Society: The basics (11th ed.). Upper Saddle River, NJ: Pearson Prentice Hall. Recommended Websites: The following are suggested websites that can be used as additional resources for researching information for your CheckPoints and Assignments. U.S.......

Words: 3608 - Pages: 15

Premium Essay

Sociology

...1. How does the meaning of "culture" differ in sociology from it's common everyday meaning? Refined music, art, and literature is referred to as culture in everyday life. People who are well versed in hese topics, are considered to be cultured. However, in sociology, the meaning of culture is more than the object or behavior. Sociologically, the term culture is the sum of inherited customs, beliefs, values and knowledge. 2. Distinguish among each of the following pairs of concepts, informal vs formal, norms vs folkways, and norms vs sanctions. Sociologists classify norms as either formal or informal. A formal norm has been written down and spcifies strict punishment. Mores have a greater significance for the welfare of society, and violations can result in severe punishments, where as folkways are looked at as contempt and are merely frowned on by society. Norms are rules that people follow without thnking about them; sanctions are rewards and penalties that help enforce society's value system. 3. How did Charles Horton Cooley approach the socialization process? In 1902, Charles Horton Cooley coined the phrase " the looking glass self". The term refers to his belief that people shape their identity based on how others percieve them. Basing themselves on the perception of others cofirms their opinion of themselves. The three main components of the looking glass self are, we imagine how we appear to others, we imagine how that appearance is judged and we develop our self......

Words: 843 - Pages: 4

Premium Essay

Sociology

...Republic of the Philippines Naval State University Naval, Biliran In In Assignment SOCIOLOGY Submitted By: OLIVER B. JAGUINES BSCpE – IIA Student Submitted To: Mrs. Ma. Joan Delda Instructor Auguste Comte (1798-1857) The legitimacy of sociology started when the term was coined by Auguste Comte, a French philosopher, and from that time on, sociologist have sought to be more scientific in their methods and more systematic in their observations. Comte’s significant contributions to advance sociology to the frontiers of human knowledge earned for him the title “Father of Sociology”. * His contribution to sociology can be divided into four categories. They are namely: (1) Classification and ordering of social sciences. (2) The nature, method and scope of sociology. (3) The law of three stages. (4) The plan for social reconstruction. (5) Positivism. * The law of human progress, states that each of our leading conceptions, each branch of knowledge, all human intellectual development, pass successively through three different theoretical conditions – the theological or fictitious, the metaphysical or abstract, and the scientific or positive. * Theological or Fictitious Stage: During the primitive stage, the early man believed that all phenomena of nature are the creation of the divine or supernatural. The primitive man and children do not have the scientific outlook; therefore it is characterized by unscientific outlook. They failed to......

Words: 1496 - Pages: 6

Premium Essay

Sociology

...The concept of sociology had been recognized by independent philosophers since the dawn of organized civilization. Philosophers such as Confucius and Xenophanes in their works had hinted at the clash of cultures and social hierarchy. Later, in the 14th century, Arab scholars such as Al Jahiz and Ibn Khaldun's compliled books on the history of society itself. These works are known to be forerunners of sociology. In fact, books written by Ibn Khaldun on social cohesion and conflict were translated into Latin in the 15th century. However, Sociology as a discipline has only been around since the late 17th century. Sociology then was very much the product of a rapidly changing world, from the violent revolutions in France to the subtle urbanization of Europe over a period of hundred years. Each philosopher, depending on the time period he was born in, and his background, contributed to sociology in his own unique way.The term "sociologie" was first coined by a French essayist named Emmanuel in the 17th century. However, little is known about his other contributions towards the field. Among most notable of early sociologists was Auguste Compte. He largey thought of sociology as a positivist science. In fact he himself coined the term positive philosophy . In his works, he established three stages of attainment of knowledge, theological, metaphysical and positive. Many historians belief that his conclusions on positivism and sociology were a direct result of the bloody French......

Words: 1244 - Pages: 5

Premium Essay

Sociology

...Reflective Essay Introduction to Sociology Nicola McMenamin 730353x Word Count: 1579 40 % Dr. John McCormack October 21st 2012 Sociology "The art of life lies in taking pleasures as they pass, and the keenest pleasures are not intellectual, nor are they always moral", this quote was once said by a Greek secular artist, by reading this quote one can presume that most philosophers and thinkers alike look for a deeper meaning within their lives and throughout society. Previous to this course my viewpoint and attitude were based on the people of which I surround myself with, the life experiences I have encountered and the way in which we make our decisions and why. Following my studies I have found this foundation of my knowledge to be valid and rather accurate although there are numerous factors which make up our decisions and how we end up where we are, studying sociology has assisted me in becoming more aware of different factors which I may have not considered to make up a society and how in turn this has enhanced my sense of identity. In relation to individuality and where I am in society I have found there are a number of entities which define me within the social order, that being of where I have lived in the world, the people I surround myself with, the cultures I have endured and seen, the values I was taught as a child and to this day as an adult and the......

Words: 1623 - Pages: 7

Premium Essay

Sociology

...P2 Explain different sociological approaches to health and ill health There are different approaches to health and ill health in sociology, and these include Functionalism, Marxism, Feminism and Interactionism. The World Health Organisation (WHO) in 1974 defines positive health as a state of complete physical mental, social, spiritual and well-being not merely the absence of disease. The holistic approach is based on addressing the individual’s physical, social, emotional and spiritual health needs. The functionalist approach to health and ill health In the functionalist model, Parsons argued that illness is a form of deviance that disturbs the social function of a society; within the functionalist approach to health it studies the relationship between a sick individual and the society as a whole. Parsons stated that for the society to function efficiently the members of the society must be free from illness and must be of well health. Functionalists argued that stability and cooperation are very crucial for a society to function efficiently; functionalists explain that through the process of socialisation we learn our society’s general norms, values and social roles. An example of this is, saying “thank you or please” these are some of the values that are treasured within societies, and an example of a social role would be a grandmother fulfilling the role as a grandmother. For the grandmother to fulfil her role, the individual has to look after the grandchildren......

Words: 2558 - Pages: 11

Premium Essay

Sociology

...produce unanticipated and harmful outcomes (Vaughan,1999). It is often an unintended consequence of the normal activities of actors within an organization” (Fox & Harding 2005) Sociology- scientific study of human behavior, social groups, and society. * As stated by the American Sociological Association, sociology is the study of social life and the social causes and the consequences of human behavior. The term social life encompasses all the interpersonal relationships, all groups or collections of person, and all types of social organizations. The “Causes and consequences of human behavior” encompass how these relationships, groups, and organizations are interrelated; how they influence personal and interpersonal behavior; how they affect and are affected by the larger society, how they change or why they remain static; and what the consequences are of these factors. This definition reflects the belief that people can be understood only in the context of their contacts, associations, and communications with other people. The very heart of sociology then its concern with the complexities and subtleties of human social life makes it a discipline that is highly relevant not only to professional sociologists, but also to people in virtually every line of work and at every level. * Thus sociology may consider a wide range of general questions such as the following; HOW DO GROUPS INFLUENCE INDIVIDUAL HUMAN BEHAVIOR? Social Imagination- quality of mind that allows......

Words: 2608 - Pages: 11

Premium Essay

Sociology

...Glossary of Sociological Terms |11-Plus Exam |Examination introduced with the 1944 Education Act, sat by all pupils in the state sector| | |at the age of 11. If they passed they went to the selective Grammar School, or if they | | |failed to the Secondary Modern School. This exam still exists in some counties such as | | |Kent and also in Northern Ireland. | |12-Plus Exam |Exam made available only to a minority of 'high-flyers' in Secondary Modern schools, | | |offering a late chance to go to Grammar School at the age of 12. | |'30-30-40 society' |A term associated with Will Hutton to describe an increasingly insecure and polarised | | |society. The bottom 30 per cent is socially excluded by poverty from the rest of society.| | |The next 30 per cent live in fear and insecurity of falling into poverty. Only the top 40| | |per cent feel secure and confident. ...

Words: 22530 - Pages: 91

Premium Essay

Sociology

...What is Sociology? Sociology is defined as the scientific study of society and human behavior. Sociology is a part of social sciences. The study of sociology aims at analyzing the patterns of human behavior, deriving their causes and speculating the future of the behavioral patterns in society.  Importance of Sociology The various disciplines of sociology include the study of social interaction between people. The areas covered by sociology include the analysis of social contacts between members of a society as also the interactions between different people around the world. Sociology attempts to study how and why people are organized as a society. It analyzes the structure of society and studies the factors that contribute to the creation of social groups. Sociology includes the study of the behavioral patterns, interactions and relationships among the individuals of society. This field tries to examine the organizational structure of society and the influence it has on the social, political and religious ideas of the members. It encompasses the study of the organization of families and businesses. It attempts to analyze the creation and management of social groups as well as the factors, which lead to their breakdown. The disciplines of sociology are concerned with the effects of social behavior on the formation of social traits. It also includes the ethical and moral values of society.  Sociology is regarded as a branch of social sciences. It deals with the......

Words: 254 - Pages: 2

Premium Essay

Sociology

...Sociology Homework 1) Define the term ‘patriarchy`. (2 Marks) A system of society or government in which the father or eldest male is head of the family and descent is reckoned through the male line. 2) Using one example, briefly explain how Marxists suggest that the next generation may be socialised into capitalist values. (2 Marks) They think those families in relations to capitalism and how it will benefit capitalism because they will have a lot more works that will work for them and that means there will be more money for the ruling class. 3) Outline three criticisms made of the New Right view of the family. (6 Marks) The family is in decline because there is an increase in: Lone parents Fatherless families Gay and Lesbian couples. Because of this the family is no longer performing its function properly, it is failing to give children proper socialisation and this leads the kids to have bad grades and it causes them to behave badly and commit crimes and it makes lone parents dependent on the welfare. (Welfare Dependency). 4) Outline and explain two function that functionalist’s sociologists see the family performing. (10 Marks) Functionalists believe that families must have a function or a purpose and they must to something useful that will benefit the family members and the society. One of the functions that George Murdock thinks that is vital for the family is being reproductive and having babies this will increase the population and......

Words: 326 - Pages: 2

Premium Essay

Sociology

...societies and world systems. * We study it to be able to evaluate the effects of gender, ethnic background, social class, religion, and community on an individual or group. Another is that the sociological perspective is crucial for success in today’s multicultural and multinational work environments. Thus, a background in social science is valuable preparation for careers in almost any modern organizational setting. 2. What are the disciplines of Social Science? * Social science is actually the commonly used as an umbrella term to refer to the academic disciplines concerned with society and the relationships among individuals within a society. These disciplines include anthropology, economics, political science, psychology and sociology and many more. 3. What is Anthropology? Why do we study Anthropology? * Anthropology is the study of humans, past and present. Anthropologists look at cross-cultural differences in social institutions, cultural beliefs, and communication styles. They often seek to promote understanding between groups by "translating" each culture to the other, for instance by spelling out common, taken-for-granted assumptions. * We study it to be able to understand the full sweep and complexity of cultures across all of human history. An anthropology class can be useful for students in a variety of majors, such as education, business, medicine, and law. Knowledge about human diversity is helpful in many careers. It is often an......

Words: 1250 - Pages: 5