Question: Revision Question 1 on Linux. Please briefly explain the shell script given. a) You have just logged in and have a directory called images in
Revision Question 1 on Linux. Please briefly explain the shell script given.
a) You have just logged in and have a directory called "images" in your home directory containing the following files:
favicons login.png logo.png newlogo.png
where "favicons is a directory and contains the files
favicon.ico favicon.gif favicon.png favicon.jpg
Describe the results you would expect when executing the following shell commands:
i) ls images/*og* | wc -1
ii) ls -ld images/*
iii) rmdir images/favicons
iv) cp images/*/*png images
v) rm -r images
(assume each command is run when the directory "images" is as described above)
b) Consider the following short shell script:
#!/bin/sh
mkdir $3
for i in $1/*$2
do
cp $i $3
touch $i
done
If this script is stored in a file called script1, what would be the effect of running this shell command:
./script1 images png newdir
c) Describe the underlying principle behind the Linux command set - often called the "UNIX philosophy".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
