Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Revision question 2 on Linux. Please briefly explain your shell scripts and commands. You have just logged in and have a directory called experiment in

Revision question 2 on Linux. Please briefly explain your shell scripts and commands.

You have just logged in and have a directory called "experiment" in your home directory containing the following files:

analysis.java paper.rtf paper.pdf raw

where "raw" is itself a directory and contains the files:

2015-01-10.dat 2015-02-11.dat 2015-03-24.dat 2015-04-06.dat exper1.txt exper2.txt exper3.txt exper4.txt

a) Describe the results you would expect when executing the following shell commands:

i) ls experiment/raw/*4*

ii) ls experiment/*/*0[23]*

iii) rm -r experiment

iv) ls experiment | wc -l

v) rmdir experiment/raw

(assume each command is run when the directory "experiment" is as described above)

b) Consider the following short shell script:

#!/bin/sh

cd $1

for i in */*.$2

do

if [ `wc -c $i ` -gt $3 ]

then

chmod a+r $i

fi

done

If this script is stored in a file called mung, what would be the effect of running this shell command:

./mung experiment txt 1000

c) Describe the underlying design principle behind the Linux command set - often called the "UNIX philosophy".

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

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

1. Are my sources credible?

Answered: 1 week ago

Question

3. Are my sources accurate?

Answered: 1 week ago

Question

1. Is it a topic you are interested in and know something about?

Answered: 1 week ago