Question: Lab 12 Unix/Linux Administration 1. (10 points) Make a script to find all old, unused files, larger than 1 megabyte, starting at a directory supplied
Lab 12 Unix/Linux Administration
1. (10 points) Make a script to find all old, unused files, larger than 1 megabyte, starting at a directory supplied by the user (default: /tmp). Make old be more than a month by default, but allow the user to change it. Similarly make the size be one megabyte by default, but allow the user to change it. (Use find command.) 2. (5 points) Find the file system layout (with the df command.) Note where each partition or separate disk is mounted, how big it is, and how much space is left on it. If you want more practice scripting, write a script that will show the mountpoints, and how much space is left on them. 3. (10 points) Copy a directory (and all its sub-directories) with tar AND with cpio. To avoid problems with recursion (copying the same files you are creating), I suggest making a directory in /tmp (with your name), and copying your home directory and its subdirectories into it. Try to preserve the owner, permission, and creation date attributes. Note that this is two different scripts. 4. (5 points) Log in remotely to newton.csmcis.net. Can you tell which daemon is handling your login? (Think ps and PPID.) . Write a script to show the commands to do this. 5. (10 points) Try to find the largest regular file in some of the partitions, either on newton.csmcis.net or (even better) on your own machine (if its some flavor of UNIX.) Try using the du and sort commands. Unless you can run as root (superuser), you wont be able to see the sizes of all the files; try to find out what you can. Either write a script, or describe the commands you would use to do this.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
