Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

. Write a shell script to create a few directories as shown below in your curren

ID: 3850354 • Letter: #

Question

. Write a shell script to create a few directories as shown below in your current directory (dir1, dir2, dir3, and dir4 in dir1, dir5 in dir2), a few files (file1 and file2 in current directory, file4 in dir4, and a soft-link link1 in dir5 (to link to file3).

You are going to create the files and directories in depth-first order. That is, dir1 will be created first, then dir4, and so on. You should create link1 (a softlink to file3) after file3 is created.

Copy and paste your shell script

dirl dir4 file4 dir2 dirs link1 From your current directory dir3 file3 file1 file2

Explanation / Answer

commands.sh

mkdir dir1
cd dir1
mkdir dir4
cd dir4
touch file4
cd ..
cd ..
mkdir dir2
cd dir2
mkdir dir5
cd ..
mkdir dir3
cd dir3
touch file3
ln -s file3 ../dir2/dir5/link1
cd ..
touch file1
touch file2