Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. In a Linux system, the dmesg command prints out kernel messages. Use the command to determine which SCSI disks the kernel attached when it

2. In a Linux system, the dmesg command prints out kernel messages. Use the command to determine which SCSI disks the kernel attached when it started up

a=$(dmesg | grep SCSI | grep Attached | cut -d ' ' -f 8)

echo $a

answer: [sda] [sdb]

3. The df command shows you how much disk space is available on a Linux system. Use the output from the previous question to write a command pipeline that prints how much disk space is available on each of the disks found in question 1. The only acceptable output consists of two numbers only. NOTE: instead of cut, you may want to use awk. To print the second field in a whitespace-delimited file using awk, use the following command: awk '{print $2}'

error in question 3

a=$(dmesg | grep SCSI | grep Attached | cut -d ' ' -f 8)

{ nothing happens }

b=$(a:1:3)

{ a:1:3: command not found }

df | grep $b | awk '{print $4}'

4. Update the command pipeline above to add up both numbers and print only one value. If you do it right, you will only need to chain two commands!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Is short-selling good for the stock markets?

Answered: 1 week ago