Question: Write a Bash script that performs the following steps: Takes the name of a file or directory as an argument. If no argument is provided,

Write a Bash script that performs the following steps:
Takes the name of a file or directory as an argument. If no argument is provided, prompt the user to enter the name.
Determines whether the input is a file or a directory.
If it's a directory:
3a. Check if the user has read and execute permissions on the directory. If not, display a warning message.
3b. Count the number of files and subdirectories within it.
3c. If the user has the necessary permissions, display the list of all files and subdirectories along with their respective sizes.
If it's a file:
4a. Check if the user has read permission on the file. If not, display a warning message.
4b. If the user has read permission, determine the word count, line count, and character count of the file. Based on the character count, categorize the file as follows:
4c-1. "Text Heavy" if the character count is greater than 10,000.
4c-2. "Moderately Sized" if the character count is between 1,000 and 10,000.
4c-3. "Light File" if the character count is less than 1,000.
 Write a Bash script that performs the following steps: Takes the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!