Question

1. Switch to a command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in to the terminal...

1. Switch to a command-line terminal (tty5) by pressing Ctrl+Alt+F5 and log in to the
terminal using the user name of root and the password of LINUXrocks!.
2. At the command prompt, type vi diskconfig.sh and press Enter to open a new file
for editing called diskconfig.sh in your home directory. Why is it good form to use a .sh
extension for shell scripts?
3. Enter the following text into the diskconfig.sh file. As you are typing the contents,
ensure that you understand the purpose of each line (reviewing the chapter contents
and appropriate man pages as necessary). When finished, save and quit the vi editor.#!/bin/bash
#This script creates a report of our disk configuration
FILENAME=‘hostname‘
echo "Disk report saved to $FILENAME.report"
echo -e "\n LVM Configuration: \n\n" >>$FILENAME.report
lvscan >>$FILENAME.report
echo -e "\n\n Partition Configuration: \n\n" >>$FILENAME.report
fdisk -l | head -17 >>$FILENAME.report
echo -e "\n\n Mounted Filesystems: \n\n" >>$FILENAME.report
df -hT | grep -v tmp >>$FILENAME.report


4. At the command prompt, type chmod u+x diskconfig.sh and press Enter. Next,
type ./diskconfig.sh at the command prompt and press Enter. Note the filename
that your report was saved to.
5. At the command prompt, type less filename where filename is the filename you
noted in the previous step, and press Enter. View the contents. Would this shell script
work well to record storage configuration from different systems? Why?

Homework Answers

Answer #1

1.Why is it good form to use a .sh extension for shell scripts?

answer - Because Linux system understand the .sh extension files as executable when we change the file permission.

2.Would this shell scriptwork well to record storage configuration from different systems?

answer - This script will run on most of the linux system. It will not run on windows system.

we need BASH install to run shell script . System equipped with bash will be able to run shell scripts.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Project 10-3 In this hands-on project, you view the configuration of the System Log Daemon and...
Project 10-3 In this hands-on project, you view the configuration of the System Log Daemon and the logrotate utility on Ubuntu Server Linux. 1. Boot your Ubuntu Server Linux virtual machine. After your Linux system has been loaded, log into tty1 using the user name of root and the password of LNXrocks!. 2. At the command prompt, type ls –l /dev/log and press Enter. What is the file type? Which daemon on Ubuntu Server Linux uses this file and what...
Open a new terminal window a) At the command prompt type the “top “command b) Screenshot...
Open a new terminal window a) At the command prompt type the “top “command b) Screenshot and post the number of running processes. c) How many sleeping processes do you have? d) How much total memory is shown? e) How much swap memory is shown? f) Describe what swap memory is and why it is important. g) While using the top command, Press the “h” key. What happens? Press “h” again to return. h) What is the PID of the...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of the separation is that they are not displayed by the default version of the ls command)                         a. the prefix "rc" (rc.filename)               c. the extension .cfig                         b. a dot (.) at the beginning                    d. by having the SUID bit set 2. The IP address which is reserved for local loopback (equivalent to "localhost") is:                         a. 255.255.255.0                                   c. 192.168.70.1...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...