Question: 1 . Create a shell script containing the ` echo ` , ` whoami ` , ` groups ` , and ` pwd ` commands.

1. Create a shell script containing the `echo`,`whoami`,`groups`, and `pwd` commands. It should produce output similar to the following:
You are:
root
You are a member of the following groups:
root bin daemon sys adm disk wheel
Your current working directory is:
/tmp
Be sure to include the following:
a. An appropriate hashpling line
b. A comment with your name and when the script was created
c. The commands required to perform the desired result
1. Create a shell script containing the `echo`,`whoami`,`groups`, and `pwd` commands. It should produce output similar to the following:
You are:
root
You are a member of the following groups:
root bin daemon sys adm disk wheel
Your current working directory is:
/tmp
Be sure to include the following:
a. An appropriate hashpling line
b. A comment with your name and when the script was created
c. The commands required to perform the desired result
2. Change the permissions on your script so it is executable as a command by any user on the system but is only writable by the owner.
3. Run your script.
4. Create another shell script containing the `id` and `groups` commands. Use a named variable in your script to represent the user name your script will get info about. You can set the value of the variable in the script, by prompting the user, or (best) by copying the value of the appropriate command line argument passed into your script. Sample output should look something like this:
[user1@md-fc13 ~]$ ./myscript root
root's UID is: 0
root is a member of these groups:
root : root bin daemon sys adm disk wheel
[user1@md-fc13 ~]$ ./myscript sam
sam's UID is: 1001
sam is a member of these groups:
sam : sam sales
5. Test your script by setting the appropriate permissions and running it.(same as #2 and #3, not scored).
6. Mount the /exports/exam share from the 10.6.96.12 NFS server on /mnt/nfsexam/.(Hint: What do you need to do first if the mount point doesn't exist?)
7. Verify that the remote storage is now mounted by displaying all currently mounted filesystems.
8. Create a file with your name in /mnt/nfsexam (on the remote server).
9. View the contents of the /mnt/nfsexam/ directory. The file you just created should appear. (not scored)
10. Disconnect from the exam share on the NFS server.
11. Verify that the storage is no longer mounted. (same as #7, not scored)
12. View the contents of the /mnt/nfsexam/ directory. The file you just created should no longer appear. Why?
13. A second hard disk has been added to your VM. It should appear as /dev/sdb. Partition /dev/sdb into two primary partitions of equal size. Set the appropriate partition type number if needed.
14. Format the first partition on /dev/sdb with the Ext4 filesystem. Leave the second partition alone.
15. Mount the newly formatted partition on /mnt/disk2/.
16. Verify that the newly formatted filesystem is now mounted by displaying all currently mounted filesystems. (same as #7, not scored)
17. What file do you need to edit to make your machine mount /mnt/disk2/ each time it boots?
18. Provide the exact line of configuration you would need to add to that file to make your machine mount /mnt/disk2/ each time it boots. (Hint: See p.200 of your text.)

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 Programming Questions!