IT 244: Introduction to Linux/Unix
Homework 7
Due
Sunday, October 27th at 11:59 PM
What You Need to Do
- Create the script hw7.sh
with Unix commands that will do what is described in the steps
below
- This file must be in an hw7
directory under your hw directory
Setup
-
From your home directory go to your it244
directory
cd it244
- Go to your hw directory
cd hw
- Create an hw7 directory
mkdir hw7
- Enter this new directory
cd hw7
- Create hw7.sh
nano hw7.sh
Specification
- Create the file hw7.sh inside
your hw7 directory using
nano
- Write the Unix command to perform the action specified
by each step
- Be sure to write a Step comment before the Unix
commands for each step
-
This step requires you to write two commands on two different lines.
In the first command copy bother10.sh from
/home/ghoffman/course_files/it244_files
to your current directory, which should be hw7.
In the second command run bother10.sh,
redirecting output to /dev/null, in the background.
Be sure you copy and run bother10.sh,
NOT bother.sh.
-
Run a command that shows the job number of the process running bother10.sh.
-
Run a command that shows the process ID of the process running bother10.sh.
-
Copy the script make_foo.sh from
~ghoffman/course_files/it244_files
to your current directory.
Run this script.
Perform a long listing of all files whose name starts with the string
"foo" using meta-characters.
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo",
followed by a single character, followed by .txt .
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo",
followed by a single digit, either 1, 3 or 5, followed by .txt .
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo",
followed by a single digit from 1 through 5 followed by .txt .
Do this using the range feature of one of the meta-characters.
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo" followed by a single digit, not 1, nor 3 nor 5, followed by .txt .
-
Using meta-characters, perform a long listing of all files whose name starts with the string "foo" followed by two digits followed by .txt .
-
Using meta-characters, perform a long listing of the files foo21.txt, foo25.txt
and foo29.txt. This must be done using a single command.
Testing
Copyright © 2020 Glenn Hoffman. All rights reserved. May not be reproduced without permission.