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

  Create a class which holds account number

Create a class named Loan which holds the account number, name of account holder, amount borrowed, term, and interest rate. Include methods to set values for each data field.

  Write program for grocery that reads products data

Write a program for a grocery that reads products data and determine and display the product that has the highest price and the average price.

  Create form to accept an arrival and departure date

Create a form that accepts an arrival and departure date for a reservation from the user and then calculates the number of nights and the total price for the reservation.

  Design of implementation codes-object oriented programming

Supporting document is required to reflect design of implementation codes and implementation details which utilises object oriented programming concepts.

  Develop a simple program for inventory system

You have to develop a simple program for an inventory system. You can choose any type of business (ie: Medical supplies, bakery, grocery shop, florist etc.)

  Program to prompt a user for hourly pay rate

Create program called "calculatePay" which will prompt user for their hourly pay rate.

  Design recursive program to generate random blurbs

A Whoozit is the character 'x' followed by zero or more 'y's. A Whatzit is a 'q' followed by either a 'z' or a 'd', followed by a Whoozit. Design and implement a recursive program that generates random Blurbs in this alien language.

  Program instantiates four dates and allots invalid values

Demonstration program instantiates four Dates and purposely allots invalid values to some of arguments; class methods will correct invalid values.

  Write a method that returns the value of base exponent

Write a method IntegerPower(base, exponent) that returns the value of base exponent For example, IntegerPower(3, 4) = 3 * 3 * 3 * 3.

  Writing script for fahrenheit in celsius temperature

Use functions to write script which enables user to enter either Fahrenheit temperature and display Celsius equivalent or enter Celsius temperature.

  Create a project in xcode

Create a new project in XCode using the Mac OS X/Command Line Tool template

  Design main driver class to instantiate-compute sum-objects

Design a main driver class to instantiate and calculate sum of several MonetaryCoin objects. Demonstrate that monetary coin inherits its parent's ability to be flipped.

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