Red Hat System Administration I 2.9 Lab PDF
Red Hat System Administration I 2.9 Lab PDF
Red Hat System Administration I 2.9 Lab PDF
NETLAB Academy Edition, NETLAB Professional Edition, and NETLAB+ are registered trademarks of Network Development Group, Inc.
“Red Hat,” Red Hat Linux, and the Red Hat “Shadowman” logo are trademarks or registered trademarks of Red Hat, Inc. in the US
and other countries.
2.9. Lab: Managing Files with Shell Expansion
Contents
Introduction ........................................................................................................................ 3
Outcomes ............................................................................................................................ 3
Lab Topology ....................................................................................................................... 4
Lab Settings ......................................................................................................................... 5
1 Performance Checklist ................................................................................................ 6
Introduction
In this lab, you will create, move, and remove files and folders using a variety of file
name matching shortcuts.
Outcomes
Familiarity and practice with many forms of wildcards for locating and using files.
Lab Topology
Lab Settings
The information in the table below will be needed in order to complete the lab. The
task sections below provide details on the use of this information.
1 Performance Checklist
The topology includes two virtual machines that are accessible to users. Take care to
perform the tasks as instructed, including using the appropriate virtual machine as
directed.
a. At the GNOME login screen, click the student user account. Enter
student when prompted for the password.
3. In your home directory, create sets of empty practice files to use for the
remainder of this lab. Use the shell tab completion to locate and complete path
names more easily.
6. Move the appropriate TV episodes into the season subdirectories. Use only two
commands, specifying destinations using relative syntax.
8. Using one command, create three more subdirectories directly under the
my_bestseller directory. Name these subdirectories editor, plot_change,
and vacation. The create parent option is not needed since the my_bestseller
parent directory already exists.
9. Change to the chapters directory. Using the home directory shortcut to specify
the source files, move all book chapters into the chapters directory, which is
now your current directory. What is the simplest syntax to specify the
destination directory?
10. The first two chapters are sent to the editor for review. To remember to not
modify these chapters during the review, move those two chapters only to the
editor directory. Use relative syntax starting from the chapters subdirectory.
11. Chapters 7 and 8 will be written while on vacation. Move the files from
chapters to vacation. Use one command without wildcard characters.
12. With one command, change the working directory to the season 2 TV episodes
location, then copy the first episode of the season to the vacation directory.
13. With one command, change the working directory to vacation, then list its files.
Episode 2 is also needed. Return to the season2 directory using the previous
working directory shortcut. This will succeed if the last directory change was
accomplished with one command. Copy the episode 2 file into vacation. Return
to vacation using the shortcut again.
14. Chapters 5 and 6 may need a plot change. To prevent these changes from
modifying original files, copy both files into plot_change. Move up one directory
to vacation's parent directory, then use one command from there.
[student@server1 vacation]$ cd ..
[student@server1 my_bestseller]$ cp chapters/mystery_chapter[56].odf
plot_change
[student@server1 my_bestseller]$ ls -l chapters
[student@server1 my_bestseller]$ ls -l plot_change
15. To track changes, make three backups of chapter 5. Change to the plot_change
directory. Copy mystery_chapter5.odf as a new file name to include the full
date (Year-Mo-Da). Make another copy appending the current time-stamp (as
the number of seconds since the epoch) to ensure a unique file name. Also make
a copy appending the current user ($USER) to the file name. See the solution for
the syntax of any commands you are unsure of (such as the arguments to pass
the date command).
16. The plot changes were not successful. Delete the plot_change directory. First,
delete all of the files in the plot_change directory. Change directory up one
level because the directory cannot be deleted while it is the working directory.
Try to delete the directory using the rm command without the recursive option.
This attempt should fail. Now use the rmdir command, which will succeed.
17. When the vacation is over, the vacation directory is no longer needed. Delete it
using the rm command with the recursive option. When finished, return to the
home directory.