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...
Chapter 8: Searching, Extracting, and Archiving Data Exercise 8.a: Using grep, find, and regular expressions (Objective...
Chapter 8: Searching, Extracting, and Archiving Data Exercise 8.a: Using grep, find, and regular expressions (Objective 3.2) Linux Distribution: Fedora (non-root user & password needed) Desktop Environment: GNOME 3 1.   If you have not already done so, boot up your computer (or virtual machine) to start the Fedora Linux distribution. 2.   When the machine has booted up, access the tty2 virtual terminal by pressing Ctrl+Alt+F2. 3.   Log on to a regular user’s account by typing in the username at the...
Launch a new terminal. a) Using SUDO edit the /etc/default/grub file b) Modify the value GRUB_TIMEOUT...
Launch a new terminal. a) Using SUDO edit the /etc/default/grub file b) Modify the value GRUB_TIMEOUT to 30 and save the configuration. c) Use # to comment out the Hidden display entry. d) Type grub2-mkconfig –o /boot/grub2/grub.cfg and hit enter e) Reboot the system. How long did you have to wait? f) Press c to enter a command prompt. g) At the grub> prompt type help and hit enter. h) Type the command lspci and hit enter. What is being...
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...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4...
please use linux/unix command terminal to complete, step 1 1-create a new directory named by inlab4 enter directory inlab4 create a new file named by reverse.c with the following contents and then close the file: /*reverse.c */ #include <stdio.h> reverse(char *before, char *after); main() { char str[100]; /*Buffer to hold reversed string */ reverse("cat", str); /*Reverse the string "cat" */ printf("reverse(\"cat\")=%s\n", str); /*Display result */ reverse("noon", str); /*Reverse the string "noon" */ printf("reverse(\"noon\")=%s\n", str); /*Display result */ } reverse(char *before,...
Please program in JAVA: Program each option such as delete line and such. Your program will...
Please program in JAVA: Program each option such as delete line and such. Your program will be a line editor. A line editor is an editor where all operations are performed by entering commands at the command line. Commands include displaying lines, inserting text, editing lines, cutting and pasting text, loading and saving files. For example, a session where the user enters three lines of text and saves them as a new file may appear as: Menu: m Delete line:...
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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT