Question: undefined Problem 1: Write a Bash script that takes the name of a file or directory as an argument, 1. reports if it is a
undefined
Problem 1: Write a Bash script that takes the name of a file or directory as an argument, 1. reports if it is a directory or a file, and if the user has read, write and execute permission on the file or directory, and 2. if it is a file, reports the size of the file and the category of the file based on its size. If the file size is greater than 1MB (1048576B), the file is a large file; if the file size is less than or equal to 1MB (1048576B) and the file size is greater than 100KB (102400B), the file is a medium file; otherwise, it is a small file. Use a sequence of if statements on the file name or file size to determine the information. To get the file size, use command du -b and command cut. Read their manual for how to use them. Problem 2: Write a shell script which: 1. accepts a filename 2. checks if file exists 3. if file exists, copy the file to the same name + bak + the current time. Problem 3: Write a Bash script that takes a list of numbers as arguments. The output is the sum of the numbers. Problem 4: Write a Bash script that removes all zero length ordinary files in the directory (including those in the sub-directories at all levels) passed as an optional argument. If you do not specify the directory argument, the script uses the current working directory as the default argument. This problem is for practicing bash programming skills. Though there is an easier way to achieve the goal with the find command, the find command is not allowed to appear in your bash script
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
