Question: 6. Perform the following tasks. Effectively use channel rerouting, pipe operator and filter commands (see lecture notes #14-17) a) Given any directory, find out all

6. Perform the following tasks. Effectively use channel rerouting, pipe operator and filter commands (see lecture notes #14-17)

a) Given any directory, find out all directories in it (including the hidden ones, or not).

b) Given any directory, find out the number of all files (including directories, and all hidden items) in it

c) Given any directory, find out the number of all hidden items (files and directories) in it

d) Take a screenshot (#3-3) of any one step a) to c) which clearly shows the command you use and the result.

e) Find out the first 20 commands executed and recorded in history.

f) Find all commands in command history that starting with ls, and save the result to a file. (This will be a bit challenging.)

7. Try the following and see what happens. Explains the behavior.

a) echo ".""."

b) echo "hello world"

c) echo hello world

d) echo "hello!1"; (how to display the text as is?)

8. Assume you have made the following variable assignment: person=zach How can you produce the following outputs on the screen?

a) zach

b) $person

b) "zach" - Take a screenshot (#3-4) which clearly shows the command you use and the result.

a) "$person"

9. Set var1 to the value as shown in the right figure. Whats the difference between the following two statements? How many arguments does each echo command see?

echo "$var1"

echo $var1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!