File Processing Commands Worksheet
POS/433 Version 2
1
University of Phoenix Material
File Processing Commands Worksheet
· What UID and PID have the highest amount of physical memory a process has used and is not swapped out? Show all processes and full output.
· If using a long listing and no process modifiers, what is the swap space amount for the bash command?
· When using top command, what command would you use to kill a process?
· If you were not using top command, what command would you use to kill a process?
· What command would you use to manually mount the standard CD-ROM device /dev/db1 at /media/disk?
· What command would you use to display the amount of available disk space on /dev/db1 in a human readable form?
· Type in the command grep - - help to access the help manual. Using this information and the information from the text, how would you write a command to find the pattern 111 in a file called myfile.txt?
Title
ABC/123 Version X
1
Week 6 Options
QNT/561 Version 9
1
University of Phoenix MaterialOption 1: Manufacturing Database
This database contains six variables taken from 20 industries and 140 subindustries in the United States. Some of the industries are food products, textile mill products, furniture, chemicals, rubber products, primary metals, industrial machinery, and transportation equipment. The six variables are Number of Employees, Number of Production Workers, Value Added by Manufacture, Cost of Materials, End-of-Year Inventories, and Industry Group. Two variables, Number of Employees and Number of Production Workers, are in units of 1000. Three variables, Value Added by Manufacture, Cost of Materials, and End-of-Year Inventories, are in million-dollar units. The Industry Group variable consists of numbers from 1 to 20 to denote the industry group to which the particular subindustry belongs. Option 2: Hospital Database
This database contains observations for six variables on U.S. hospitals. These variables include Geographic Region, Control, Service, Census, Number of Births, and Personnel.
The region variable is coded from 1 to 7, and the numbers represent the following regions:
1 = South
2 = Northeast
3 = Midwest
4 = Southwest
5 = Rocky Mountain
6 = California
7 = Northwest
Control is a type of ownership. Four categories of control are included in the database:
1 = government, nonfederal
2 = nongovernment, not-for-profit
3 = for-profit
4 = federal government
Service is the type of hospital. The two types of hospitals used in this database are:
1 = general medical
2 = psychiatric
Option 3: Consumer Food
The consumer food database contains five variables: Annual Food Spending per Household, Annual Household Income, Non-Mortgage Household Debt, Geographic Region of the U.S. of the Household, and Household Location. There are 200 entries for each variable in this database representing 200 different households from various regions and locations in the United States. Annual Foo ...
File Processing Commands WorksheetPOS433 Version 21Univ.docx
1. File Processing Commands Worksheet
POS/433 Version 2
1
University of Phoenix Material
File Processing Commands Worksheet
· What UID and PID have the highest amount of physical
memory a process has used and is not swapped out? Show all
processes and full output.
· If using a long listing and no process modifiers, what is the
swap space amount for the bash command?
· When using top command, what command would you use to
kill a process?
· If you were not using top command, what command would you
use to kill a process?
· What command would you use to manually mount the standard
CD-ROM device /dev/db1 at /media/disk?
· What command would you use to display the amount of
available disk space on /dev/db1 in a human readable form?
· Type in the command grep - - help to access the help manual.
Using this information and the information from the text, how
would you write a command to find the pattern 111 in a file
called myfile.txt?
Title
ABC/123 Version X
1
Week 6 Options
QNT/561 Version 9
2. 1
University of Phoenix MaterialOption 1: Manufacturing
Database
This database contains six variables taken from 20 industries
and 140 subindustries in the United States. Some of the
industries are food products, textile mill products, furniture,
chemicals, rubber products, primary metals, industrial
machinery, and transportation equipment. The six variables are
Number of Employees, Number of Production Workers, Value
Added by Manufacture, Cost of Materials, End-of-Year
Inventories, and Industry Group. Two variables, Number of
Employees and Number of Production Workers, are in units of
1000. Three variables, Value Added by Manufacture, Cost of
Materials, and End-of-Year Inventories, are in million-dollar
units. The Industry Group variable consists of numbers from 1
to 20 to denote the industry group to which the particular
subindustry belongs. Option 2: Hospital Database
This database contains observations for six variables on U.S.
hospitals. These variables include Geographic Region, Control,
Service, Census, Number of Births, and Personnel.
The region variable is coded from 1 to 7, and the numbers
represent the following regions:
1 = South
2 = Northeast
3 = Midwest
4 = Southwest
5 = Rocky Mountain
6 = California
3. 7 = Northwest
Control is a type of ownership. Four categories of control are
included in the database:
1 = government, nonfederal
2 = nongovernment, not-for-profit
3 = for-profit
4 = federal government
Service is the type of hospital. The two types of hospitals used
in this database are:
1 = general medical
2 = psychiatric
Option 3: Consumer Food
The consumer food database contains five variables: Annual
Food Spending per Household, Annual Household Income, Non-
Mortgage Household Debt, Geographic Region of the U.S. of
the Household, and Household Location. There are 200 entries
for each variable in this database representing 200 different
households from various regions and locations in the United
States. Annual Food Spending per Household, Annual
Household Income, and Non-Mortgage Household Debt are all
given in dollars. The variable Region tells in which one of four
regions the household resides. In this variable, the Northeast is
coded as 1, the Midwest is coded 2, the South is coded as 3, and
the West is coded as 4. The variable Location is coded as 1 if
the household is in a metropolitan area and 2 if the household is
outside a metro area. The data in this database were randomly
derived and developed based on actual national norms.
5. QNT/561 Version 9
2
Part 3: Inferential Statistics Option 1: Manufacturing Database
1. The National Association of Manufacturers (NAM) contracts
with your consulting company to determine the estimate of
mean number of production workers. Construct a 95%
confidence interval for the population mean number of
production workers. What is the point estimate? How much is
the margin of error in the estimate?
2. Suppose the average number of employees per industry group
in the manufacturing database is believed to be less than 150
(1000s). Test this belief as the alternative hypothesis by using
the 140 SIC Code industries given in the database as the
sample. Let α = .10. Assume that the number of employees per
industry group are normally distributed in the population.
3. You are also required to determine whether there is a
significant difference between mean Value Added by the
Manufacturer and the mean Cost of Materials in manufacturing
using alpha of 0.01.
4. You are requested to determine whether there is a
significantly greater variance among values of Cost of Materials
than of End-of-Year Inventories.
Option 2: Hospital Database
1. As a consultant, you need to use the Hospital database and
construct a 90% confidence interval to estimate the average
census for hospitals. Change the level of confidence to 99%.
What happened to the interval? Did the point estimate change?
2. Determine the sample proportion of the Hospital database
under the variable “service” that are “general medical”
(category 1). From this statistic, construct a 95% confidence
interval to estimate the population proportion of hospitals that
are “general medical.” What is the point estimate? How much
6. error is there in the interval?
3. Suppose you want to “prove” that the average hospital in the
United States averages more than 700 births per year. Use the
hospital database as your sample and test this hypothesis. Let
alpha be 0.01.
4. On average, do hospitals in the United States employ fewer
than 900 personnel? Use the hospital database as your sample
and an alpha of 0.10 to test this figure as the alternative
hypothesis. Assume that the number of births and number of
employees in the hospitals are normally distributed in the
population.
Option 3: Consumer Food
1. Suppose you want to test to determine if the average annual
food spending for a household in the Midwest region of the U.S.
is more than $8,000. Use the Midwest region data and a 1%
level of significance to test this hypothesis. Assume that annual
food spending is normally distributed in the population.
2. Test to determine if there is a significant difference between
households in a metro area and households outside metro areas
in annual food spending. Let α = 0.01.
3. The Consumer Food database contains data on Annual Food
Spending, Annual Household Income, and Non-Mortgage
Household Debt broken down by Region and Location. Using
Region as an independent variable with four classification
levels (four regions of the U.S.), perform three different one-
way ANOVA's—one for each of the three dependent variables
(Annual Food Spending, Annual Household Income, Non-
Mortgage Household Debt). Did you find any significant
differences by region?
Option 4: Financial Database
8. Part 3: Inferential Statistics Option 1: Manufacturing Database
1. The National Association of Manufacturers (NAM) contracts
with your consulting company to determine the estimate of
mean number of production workers. Construct a 95%
confidence interval for the population mean number of
production workers. What is the point estimate? How much is
the margin of error in the estimate?
2. Suppose the average number of employees per industry group
in the manufacturing database is believed to be less than 150
(1000s). Test this belief as the alternative hypothesis by using
the 140 SIC Code industries given in the database as the
sample. Let α = .10. Assume that the number of employees per
industry group are normally distributed in the population.
3. You are also required to determine whether there is a
significant difference between mean Value Added by the
Manufacturer and the mean Cost of Materials in manufacturing
using alpha of 0.01.
4. You are requested to determine whether there is a
significantly greater variance among values of Cost of Materials
than of End-of-Year Inventories.
Option 2: Hospital Database
1. As a consultant, you need to use the Hospital database and
construct a 90% confidence interval to estimate the average
census for hospitals. Change the level of confidence to 99%.
What happened to the interval? Did the point estimate change?
2. Determine the sample proportion of the Hospital database
under the variable “service” that are “general medical”
(category 1). From this statistic, construct a 95% confidence
interval to estimate the population proportion of hospitals that
are “general medical.” What is the point estimate? How much
error is there in the interval?
9. 3. Suppose you want to “prove” that the average hospital in the
United States averages more than 700 births per year. Use the
hospital database as your sample and test this hypothesis. Let
alpha be 0.01.
4. On average, do hospitals in the United States employ fewer
than 900 personnel? Use the hospital database as your sample
and an alpha of 0.10 to test this figure as the alternative
hypothesis. Assume that the number of births and number of
employees in the hospitals are normally distributed in the
population.
Option 3: Consumer Food
1. Suppose you want to test to determine if the average annual
food spending for a household in the Midwest region of the U.S.
is more than $8,000. Use the Midwest region data and a 1%
level of significance to test this hypothesis. Assume that annual
food spending is normally distributed in the population.
2. Test to determine if there is a significant difference between
households in a metro area and households outside metro areas
in annual food spending. Let α = 0.01.
3. The Consumer Food database contains data on Annual Food
Spending, Annual Household Income, and Non-Mortgage
Household Debt broken down by Region and Location. Using
Region as an independent variable with four classification
levels (four regions of the U.S.), perform three different one-
way ANOVA's—one for each of the three dependent variables
(Annual Food Spending, Annual Household Income, Non-
Mortgage Household Debt). Did you find any significant
differences by region?
Option 4: Financial Database
1. Use this database as a sample and estimate the earnings per
share for all corporations from these data. Select several levels
11. Date: <Insert the date (XX/XX/XXXX)>
Directions: As you complete each of the following steps, keep
track of what occurs at each point; including what you type, the
output given, and if you experience any errors. Record the
occurrences in the following matrix.
1. Open a terminal.
2. Create a new group called mygroup. Hint: /usr/sbin/groupadd.
3. Create a new folder and name it your first name.
4. Get a directory listing of the home folder using the long
listing format.
5. Modify the permissions on your new folder to set read, write,
and execute permissions for the user and group.
6. Get a directory listing of the new folder using the long listing
and human readable format. (ls –lh)
7. Use Gedit or VI to create two files (myfile1.txt and
myfile2.txt) and save them in the new folder. Add a paragraph
of your own liking to each file.
8. Get a regular format directory listing of the new folder.
9. Change the ownership of myfile1.txt so the owner is mygroup
and the group is mygroup.
10. Get a directory listing of the new folder using the long
listing and human readable format.
11. Change the permissions on myfile2.txt using the following:
user:read and write, group:read and write, and owner: read,
write, and execute. Set the sticky bit. Use Octal s to set these.
12. Get a directory listing of the new folder using the long
listing and human readable format.
Linux® Directory Log
12. POS/433 Version 2
1
University of Phoenix Material
Linux® Directory Log
To: <Insert your facilitator's name>
From: <Insert your name>
Date: <Insert the date (XX/XX/XXXX)>
Directions: As you complete each of the following steps, keep
track of what occurs at each point; including what you type, the
output given, and if you experience any errors. Record the
occurrences in the following matrix.
1. Open a terminal.
2. Create a new group called mygroup. Hint: /usr/sbin/groupadd.
3. Create a new folder and name it your first name.
4. Get a directory listing of the home folder using the long
listing format.
5. Modify the permissions on your new folder to set read, write,
and execute permissions for the user and group.
6. Get a directory listing of the new folder using the long listing
and human readable format. (ls –lh)
7. Use Gedit or VI to create two files (myfile1.txt and
myfile2.txt) and save them in the new folder. Add a paragraph
of your own liking to each file.
8. Get a regular format directory listing of the new folder.
9. Change the ownership of myfile1.txt so the owner is mygroup
and the group is mygroup.
10. Get a directory listing of the new folder using the long
listing and human readable format.
11. Change the permissions on myfile2.txt using the following:
user:read and write, group:read and write, and owner: read,
13. write, and execute. Set the sticky bit. Use Octal s to set these.
12. Get a directory listing of the new folder using the long
listing and human readable format.
Linux Script Worksheet
POS/433 Version 2
1
University of Phoenix Material
Linux® Script Worksheet
To: <Insert your facilitator's name>
From: <Insert your name>
Date: <Insert the date (XX/XX/XXXX)>
Before beginning the Linux® Script Worksheet, update the
PATH variable to add your folder from last week. You will find
how to do this on p. 134 of Linux® Command Lineand Shell
Scripting Bible. Linux® Script 1
Requirements
In the same folder as part 1, create a new file titled
week3prog1[name].scr.
Change the permissions on this new file to add the execute bit
for user, group, and owner.
Edit your new file using Gedit or VI and change it so it
performs the following actions:
· Display the date
· Display the words Hello World
· Display information about users that are currently logged in
14. Note: Remember to include #!/bin/bash as the first line of your
script.
Save the file and type your file name to execute.
Source Programs
<Insert your source code here.>Output Results
<Insert the output here. Use a screenshot of the output with the
input requirements specified in the assignment.>
Linux® Script 2
Requirements
In the same folder as last week, create a new file called
week3prog2[name].scr.
Change the permissions on this new file to add the execute bit
for user, group, and owner.
Edit your new file using Gedit or VI and change it so it
performs the following actions:
· Using a line after #!/bin/bash, take the output of the ps –e
command and pipe it to the sort command
· After it has been piped to the sort command, redirect that
output to a file called psfile
Note: Remember to include #!/bin/bash as the first line of your
script.
Source Programs
<Insert your source code here.>Output Results
<Insert the output here. Use a screenshot of the output with the
input requirements specified in the assignment.>
Linux® Script 3
15. Requirements
In the same folder as Part one, create a new file called
week3prog3[name].scr.
Change the permissions on this new file to add the execute bit
for user, group, and owner.
Create two files.
· File1 has one line with the value of 5.
· File2 has one line with the value of 100.
Edit your new file using Gedit or VI and change it so it
performs the following actions:
· Read the values from the two files above (file1 and file2)
· Divide the value from file2 by the value in file1
· Output the result of this calculation to a new file called file3
Note: Remember to include #!/bin/bash as the first line of your
script.
Source Programs
<Insert your source code here.>Output Results
<Insert the output here. Use a screenshot of the output with the
input requirements specified in the assignment.>
Systems Administration Scripting Log
POS/433 Version 2
1
University of Phoenix Material
16. Systems Administration Scripting Log
To: <Insert your facilitator's name>
From: <Insert your name>
Date: <Insert the date (XX/XX/XXXX)>
As you complete each of the following steps, keep track of what
occurs at each point; including what you type, the output given,
and any errors experienced. Submit this information in a log to
your instructor for this week’s assignment. Your log can use the
sample format provided, or you can create your own.
1. In the same folder Part 2, create a new file titled
week4prog1[name].scr.
2. Change the permissions on this new file to add the execute
bit for user, group, and owner.
3. Run the following script:
a. #!/bin/bash
b. count=1
c. echo "start of the program"
d. while [ $count -le 10 ]
e. do
1) echo "Loop #$count"
2) sleep 10
3) count=$[ count + 1 ]
f. done
g. echo "end of the program
17. 4. Modify the program to add a trap for SIGINT and SIGTERM.
5. Save the script and then run the script in the background.
6. Use the jobs command to display a list of the jobs currently
running.
7. Find the process id of the script and kill the job.
8. Check to see if you get the trap message.
9. Run the script again using the at command to schedule the
job in the future. Wait for the job to run to make sure it
executes.