Networking Chapter 2 Homework Unixlinuxcommand Before Including Options Arguments With That Commandlisting Directory Contents1 Describe The

subject Type Homework Help
subject Pages 11
subject Words 4957
subject Authors Michael Palmer

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
A Guide to Unix Using Linux, Fourth Edition 2-1
Chapter 2
Exploring the UNIX/Linux File Systems and File Security
At a Glance
Instructor’s Manual Table of Contents
Overview
Objectives
Teaching Tips
page-pf2
A Guide to Unix Using Linux, Fourth Edition 2-2
Lecture Notes
Overview
Chapter 2 offers an introduction to UNIX/Linux file systems. Students learn about
inodes and the elements of the root hierarchy. They also learn how to use paths,
Chapter Objectives
Discuss UNIX/Linux file systems
Explain partitions and inodes
Understand the elements of the root hierarchy
Use the mount command
Explain and use paths, pathnames, and prompts
Teaching Tips
Understanding UNIX/Linux File Systems
2. Stress that UNIX/Linux systems support many file systems, including ufs and ext fs.
4. Note that the native file system in Linux systems is ext. Briefly describe the properties
of this file system and introduce the concept of extents.
page-pf3
A Guide to Unix Using Linux, Fourth Edition 2-3
5. Use Table 2-1 to briefly describe the characteristics of the typical file systems supported
by UNIX/Linux. A comparison of four of these file systems is provided in Table 2-2.
Understanding the Standard Tree Structure
1. The treelike structure for UNIX/Linux file systems starts at the root file system level.
Using UNIX/Linux Partitions
1. Describe the role of partitions in UNIX/Linux systems. Use examples to explain how
partition names are interpreted in UNIX/Linux systems.
2. Introduce the following terms: peripherals, IDE, SCSI, and EIDE. Figure 2-2 shows two
partition tables: one with an IDE drive and the other with a SCSI drive.
Teaching
IDE is sometimes referred to as Integrated Device Electronics. The American
National Standards Institute (ANSI) standard for IDE is actually named
Advanced Technology Attachment (ATA). ATA and SCSI are standards
Modern computers come with one or more Universal Serial Bus (USB)
connections for connecting keyboards, pointing devices, printers, and external
hard drives. An external hard drive (that you plug into a USB port on your
page-pf4
A Guide to Unix Using Linux, Fourth Edition 2-4
Fedora, Red Hat Enterprise Linux, and SUSE have an Automatic Partitioning
Setting Up Hard Disk Partitions
2. Explain that some UNIX/Linux vendors recommend at least three partitions: the root
partition, a swap partition, and a /boot partition. Briefly describe the role of each of
these partitions. Don’t forget to introduce the term virtual memory.
Teaching
References to the root file system directory (/) and to the directory used by the
more.
3. Explain that it may be useful to have other partitions too: /usr (where you can install
utilities), /home, and /var.
4. It is important that students understand that you must mount a partition so that it
becomes part of the file system.
Setting up partitions might seem like a big task when you are learning
page-pf5
A Guide to Unix Using Linux, Fourth Edition 2-5
Using Inodes
1. Explain the role of information nodes or inodes in UNIX/Linux file systems. Note that
2. List the three components of an inode: the file or directory name, the general
3. Introduce the concept of superblocks.
Quick Quiz 1
1. The section of the disk that holds a file system is called a(n) ____________________.
2. The ____________________ partition acts like an extension of memory, so that
UNIX/Linux have more room to run large programs.
3. Inode ____________________ contains the root of the directory structure (/) and is the
jumping-off point for all other inodes.
4. You can display inode information for directories and files by using the
____________________ command.
Exploring the Root Hierarchy
2. Stress that the root file system contains all essential programs for file system repair and
information for mounting other file systems.
page-pf6
A Guide to Unix Using Linux, Fourth Edition 2-6
The /bin Directory
1. Describe the role of the /bin directory in UNIX/Linux systems. Introduce the terms
binaries and executables.
The /boot Directory
1. Describe the role of the /boot directory in UNIX/Linux systems. Introduce the term
bootstrap loader.
The /dev Directory
1. Describe the role of the /dev directory in UNIX/Linux systems.
Another method for managing devices is the use of a named pipe, which offers a
2. Use Table 2-3 to introduce the term device special file. Briefly describe some
UNIX/Linux device special files.
If you need to create a device special file for a new device, you can do so by
3. Use Figure 2-3 to introduce the following terms: block special files and character
special files.
The /etc Directory
1. Describe the role of the /etc directory in UNIX/Linux systems.
page-pf7
A Guide to Unix Using Linux, Fourth Edition 2-7
2. Briefly describe the use of the following files in /etc: fstab, group, inittab, login.defs,
motd, passwd, printcap, termcap, profile, bashrc, and rc.
Teaching
To get a taste of what is in the /etc directory, try viewing the contents of the fstab
The /home Directory
1. Describe the role of the /home directory in UNIX/Linux systems.
The /lib Directory
1. Describe the role of the /lib directory in UNIX/Linux systems.
3. Note that many files in this directory are symbolic links to other library files.
One way to save typing time is to create a symbolic link to a directory that has a
The /mnt Directory
1. Describe the role of the /mnt directory in UNIX/Linux systems.
The /media Directory
1. Describe the role of the /media directory in UNIX/Linux systems. Stress that this
directory is a relatively new recommendation of the Filesystem Hierarchy Standard
(FHS).
page-pf8
A Guide to Unix Using Linux, Fourth Edition 2-8
Guidelines for the file hierarchy in UNIX/Linux are provided by the Filesystem
The /proc Directory
1. Describe the role of the /proc directory in UNIX/Linux systems. Explain that this
directory is a virtual file system allocated in memory only.
The /root Directory
1. Describe the role of the /root directory in UNIX/Linux systems.
The /sbin Directory
1. Describe the role of the /sbin directory in UNIX/Linux systems.
The /tmp Directory
1. Describe the role of the /tmp directory in UNIX/Linux systems.
The /usr Directory
1. Describe the role of the /usr directory in UNIX/Linux systems. Note that this directory
is frequently located on the /usr partition.
The /var Directory
1. Explain that located on the /var partition, the /var directory holds subdirectories that
often change in size. Note that this directory holds subdirectories that often change in
size. Provide some examples that illustrate the use of this directory.
page-pf9
A Guide to Unix Using Linux, Fourth Edition 2-9
Quick Quiz 2
1. UNIX/Linux devices are managed through the use of ____________________ files,
which contain information about I/O devices that are used by the operating system
kernel when a device is accessed.
2. A(n) ____________________ is a name, file name, or directory name that contains a
pointer to a file or directory in the same directory or in another directory on your
system.
3. In newer distributions of UNIX/Linux, mount points for removable storage are in the
/media directory, which is a relatively new recommendation of the
____________________ (FHS).
4. The /proc directory occupies no space on the disk; it is a(n) ____________________
file system allocated in memory only.
Using the mount Command
1. Introduce the syntax of the mount command. Use a couple of examples to illustrate the
use of this command.
2. Explain that you must use umount before removing the storage media.
Teaching
Tip
To ensure security on the system, only the root user can normally use the mount
command. Ordinary users can sometimes mount and unmount file systems
located on floppy disks and CDs/DVDs, but some operating systems require the
page-pfa
A Guide to Unix Using Linux, Fourth Edition 2-10
Some systems still include legacy floppy disk drives. To mount a floppy disk,
first insert it and then use one of the following commands (where filesystem is
the floppy disk file system, such as vfat for porting a floppy to a Windows
Using Paths, Pathnames, and Prompts
2. Use examples to describe how pathnames are used to specify a file or directory. Note
Using and Configuring Your Command-Line Prompt
1. Use Figure 2-4 to describe the role of the PS1 variable in how your command prompt
appears on screen. Remind students that ~ is shorthand for the home directory.
2. Use Table 2-4 to briefly describe the most important formatting characters for
configuring a Bash shell prompt.
The pwd Command
1. Describe the syntax of the pwd command and explain that pwd comes from “print
working directory”.
page-pfb
A Guide to Unix Using Linux, Fourth Edition 2-11
Navigating the File System
1. Explain how to use the cd command to navigate the file system of a UNIX/Linux
system. You should distinguish between absolute path navigation and relative path
navigation. Provide two or more examples to illustrate these concepts.
Using Dot and Dot Dot Addressing Techniques
1. Use examples to explain how to use the dot and dot dot UNIX/Linux addressing
techniques.
When you use UNIX/Linux commands, always pay close attention to spaces. For
Listing Directory Contents
1. Describe the syntax of the ls command and use an example to show students how to
interpret its output (you may refer to Figure 2-5).
Using Wildcards
2. Use several examples to explain how to use the * and ? wildcards to navigate the file
system. Verify that students feel comfortable with the use of wildcards.
page-pfc
A Guide to Unix Using Linux, Fourth Edition 2-12
Wildcards are connected to the shell that you are using. The* and ? wildcards are
Creating and Removing Directories
1. Describe the syntax of the mkdir and rmdir commands.
Copying and Deleting Files
1. Describe the syntax of the cp and rm commands. Stress the importance of the i option
Configuring File Permissions for Security
2. Verify that students understand that the original file owner of a file is the account that
created it, but that file ownership can be transferred to another account.
4. Describe the syntax of the chmod command. Provide several examples to show how to
use this command, both in the regular and octal permission formats. Introduce the
concept of group ids (GIDs).
In many UNIX/Linux distributions, when the system administrator creates an
account, a group with the same name as the user account is created. The system
page-pfd
makes a special provision.
Teaching
Tip
If you want to set security on a directory to ensure that users must know the
exact path to a file in that directory (so they can execute a program, but not
snoop), configure the directory to have 711 permissions. This gives all
5. Table 2-5 provides some useful suggestions for setting permissions.
6. Briefly describe the role of the three advanced permissions: sticky bit, set user id
(SUID) bit, and set group ID (SGID) bit.
Quick Quiz 3
1. A(n) ____________________ is a special character that can stand for any other
character or, in some cases, a group of characters.
2. The ____________________ command is used to create a new directory.
3. The UNIX/Linux copy command is ____________________, which is used to copy
files from one directory to another.
4. You use the UNIX/Linux ____________________ command to set file permissions.
page-pfe
A Guide to Unix Using Linux, Fourth Edition 2-14
Class Discussion Topics
1. Ask students to comment on their experiences with different file systems (in either
UNIX/Linux or Windows systems). Which file system do they prefer and why?
2. Accidentally deleting a file is a common problem. Ask students if they have tried to
recover lost files in any type of file system. Have they been able to recover them? If so,
what was the process?
Additional Projects
2. Ask students to compile a list of the commands used to navigate and manipulate
3. Another common method for file system navigation is the use of file managers. Ask
students to do some research on at least five different graphical file managers available
Additional Resources
1. How UNIX file permissions work:
3. Linux Tutorials: Mounting a USB or Pen Drive in Linux:
5. File manager:
Key Terms
/boot partition A partition that is used to store the operating system files that
compose the kernel.
page-pff
binaries The programs residing in the /bin directory and elsewhere that are needed
to start the system and perform other essential tasks. See also executables.
block special file In UNIX/Linux, a file used to manage random access devices that
involve handling blocks of data, including CD/DVD drives, hard disk drives, tape
drives, and other storage devices. Also called a block device file.
Enhanced IDE (EIDE) An improved version of IDE that offers faster data transfer
speeds and is commonly used in modern computers. See also Integrated Drive
Electronics.
executables The programs residing in the /bin directory that are needed to start the
system and perform other essential tasks. See also binaries.
file and that represents contiguous space, so that as the file grows, all of it remains in
the same location on disk. The use of extents reduces file fragmentation on a disk,
which reduces disk wear and the time it takes to retrieve information.
file The basic component for data storage.
file system An operating system’s way of organizing files on mass storage devices,
page-pf10
directories and files. Inode information includes (1) the name of a directory or file, (2)
general information about that directory/file, and (3) information (a pointer) about how
to locate the directory/file on a disk partition.
Integrated Drive Electronics (IDE) Sometimes called Integrated Device
Electronics, the most popular electronic hard disk interface for personal computers. This
directories and subdirectories on the branches of the tree structure. A forward slash (/)
separates each directory name. For example, the pathname of the file phones (the
destination file) in the source directory of Jean’s directory within the /home directory is
/home/jean/source/phones.
peripherals The equipment connected to a computer via electronic interfaces.
but also gives members of a group temporary ownership while executing that program.
set user ID (SUID) bit Enables the owner of a program to retain full ownership, but
also gives an ordinary user temporary ownership while executing that program.
shared library images The files residing in the /lib directory that programmers use
to share code, rather than copying this code into their programs. Doing so makes their
page-pf11
layout of blocks. This information is the key to finding anything on the file system, and
it should never change.
swap partition A section of the hard disk separated from other sections so that it
functions as an extension of memory, which means it supports virtual memory. A
computer system can use the space in this partition to swap information between disk
of the kernel.
virtual file system A system that occupies no disk space, such as the /proc directory.
The virtual file system references and lets you obtain information about which programs
and processes are running on a computer.
virtual memory A memory resource supported by the swap partition, in which the
system can swap information between disk and RAM, allowing the computer to run
faster and more efficiently.
virtual storage The storage that might be allocated via different disks or file systems
(or both), but that is transparently accessible as storage to the operating system and
users.
wildcard A special character that can stand for any other character or, in some cases,
a group of characters, and is often used in an argument, such as ls file.* .
Technical Notes for Hands-On Projects
All projects in this chapter are performed from the command line, such as from a terminal
window. For this and all projects in this chapter, unless otherwise specified as in Hands-on

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.