Write down script to report cumulative size of all files

Assignment Help Programming Languages
Reference no: EM1371936

Write a script that will report the cumulative size of all the files in and below a given directory. Your script will also report the name and size (in bytes) of the largest file with that directory tree. Your script will also report the percentage of space used (for that "largest" file) relative to the total cumulative size of all files. In this case, only select plain files (no symbolic links or directories).

Your script will accept a single directory argument. You script will perform argument checking to make sure that there is only one argument and that the argument is an existing directory. Your script needs to handle the cases when all the file sizes are zero or the given directory is empty. In other words, watch out for divide by zero errors. Use the find command to traverse the directory and search for "plain files" and generate the "long listing" for each file. Use the awk command to calculate the sum of the file sizes.

Test your script.

You may use the touch command to create a file with a specific size (see the man page). Be careful not to exceed any disk quota that may have been imposed on your account by the system admin.

Reference no: EM1371936

Questions Cloud

Computing optimal level of input required : Suppose ZCorp has following short run production function Q = 50X - 2X^2 where X is the only variable input used by ZCorp to product its product, Q.
Program to compute gross wages for employee using array : Write program which uses the following arrays: payRate: array of seven floats to hold each employee's hourly pay rate. wages: array of seven floats to hold each employee's gross wages.
Reward system and financial reporting act : Would the reward system vary among retailers, manufacturers, distributors, financial organizations? What other characteristics should good performance incentives have?
Explain the term stereotype threat : Explain what the term "Stereotype Threat" that happens to an individual of a different cultural when they are trying to take an IQ test.
Write down script to report cumulative size of all files : Write down script which will report cumulative size of all files in and below given directory. Your script will also report name and size (in bytes) of largest file with that directory tree.
Fallacies and consequences-race and ethnicity : Reflect upon the Individualistic Fallacy, Legalistic Fallacy, and Ahistorical Fallacy. Relate these fallacies to the information you learned from the video. Why might these fallacies exist? What are the consequences of these fallacies?
Labor supply curve for cashiers : In Chicago 120 people are wants to work as cashiers if the wage is $6 a hour. For each $1 that the wage rises above $6 an additional 40 people are wants to work as cashiers.
Conflict theory-relevance today : Conflict theory suggests that the rich (powerful) make rules and enforce them against the poor (powerless). Does this theoretical perspective seem relevant today? Please cite the recent incident (political or otherwise) that would support your arg..
Find the technical rate of substitution : Suppose a company that uses two inputs. The quantity used of input 1 is denoted by x_1 and the quantity used of input 2 is denoted through x_2.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write parameterized function to play the game

Your program cannot use file level variables or constants; your program cannot use global variables or constants. The functions that you write exchange data by means of return statements and value parameters and reference parameters

  Program to compute percentage and final grade for students

Write a program which will permit teacher to compute percentage and final grade for students in a class.

  Designing the site links

Company needs to be able to schedule the time of day when the connections are available for replication. Replication should not occur during peak business hours. When designing the site links, which of the following options should you use?

  Define class that contains member variable of type string

Define a class named Document that contains a member variable of type String named text that stores any textual content for the document.

  Write program that computes loan payments

Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest rate.

  Develop logic for program to read customer records

Develop the logic for a program that reads in 100 customer records and stores the first and last name and total purchases in three parallel arrays.

  Pseudocode for a program to solve mathematical problem

Pseudocode for a program to solve the following problem. A student borrows $3,000 at an interest rate 2% per month on the unpaid balance.

  Write the program which processes test data

Write the program which processes test data. Output must be student's ID, followed by answers, followed by test score, followed by test grade. Suppose the following grade scale.

  Compute the product xy

Given two integers X and Y compute the product XY (multiplication), the quotient X=Y (integer division), and the modulus X (mod Y) (remainder).

  Write gui program as subclass of jframe

Write a GUI program as subclass of JFrame. It should contain the following: Labels At the top (column headings): Meal, Quantity, Cost, At the left: label for each mea.

  Write a program to enter any number of integers in array

Write a program which permits a user to enter any number of integers, which are then stored in the array. After user enters integers, perform the following operations on array.

  Program to processes the test data

Write a program that processes the test data. The output should be the student's ID, followed by the answers, followed by the test score, and followed by the test grade.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd