O'Reilly logo

CompTIA® Linux+ Certification, Powered by LPI, Student Manual by Axzo Press

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

344 CompTIA Linux+ Certification, Powered by LPI
Unit summary: File and directory management
Topic A In this topic, you learned that all versions of Linux use a similar set of system
directories, and you learned the purpose of each of those directories. You created
directories, renamed them, and deleted them.
Topic B In this topic, you learned how to manage files. You viewed their contents and edited
them. You copied, moved, renamed, and deleted files. You did all this using both GUI
and command-line tools.
Topic C In this topic, you learned how to mount and unmount optical discs and USB drives.
You learned about file system type identifiers, device files, mount points, and the
/etc/fstab file. You learned about privilege escalation with the su and sudo commands.
Review questions
1 The standard that describes the common directories in Linux is called the _______
_______ _______.
Filesystem hierarchy standard
2 What is the purpose of the /etc directory?
Linux stores system configuration files in /etc and its subdirectories.
3 In which directory do you find system binaries that are available to users in single-
user mode?
A /usr/sbin
B /bin
C /usr/bin
D /sbin
4 True or false? Linux uses a single directory hierarchy into which all mounted
volumes are merged.
True
5 You use the _______ command to move to a new directory.
cd
6 What does the single-dot (period) hidden directory entry represent?
A The parent directory
B Your home directory
C The current directory
D The root directory
7 Which command do you use to create a directory?
A The cd command
B The md command
C The makedir command
D The mkdir command
File and directory management 345
8 True or false? The * wildcard represents any single character.
False. It represents one or more characters.
9 The vi editor has two operational modes: _______ and _______.
command, insert
10 True or false? Inodes are sort of database entries that store information about
directories, including user and group ownership, permissions, and so forth.
False. Inodes store such information about files.
11 What is a symbolic link?
A symbolic, or soft, link is essentially a pointer or reference to an actual file.
12 Conceptually, a file name in Linux is simply a cross-reference between a file’s
name and its _______.
inode ID
13 What option(s) do you add to the ls command to display file type information?
Add the -F option at minimum, though adding the -l option displays additional file information.
14 True or false? Files in a directory to which you mount a volume are deleted.
False. Those files are simply hidden until you unmount the volume.
15 When unmounting a file system, which do you provide as an argument, the device
file name or the mount point name?
You can specify either.
16 The preferred command for privilege escalation is _______.
sudo
Independent practice activity
1 Use vi to edit myvifile. Delete the word “brown” that comes before “dog,” so that
the text reads, “…over the lazy dog.” Using the command key sequence, delete the
first line of text. Delete the second line. Enter this new text, “The five boxing
wizards jump quickly.” Use the command key sequence to quit without saving. Use
the cat command to confirm that the file contains its original text.
2 Plug a USB drive into an available port on your computer. If necessary, mount the
volume. Use
tee or touch to create a file on the drive. Display the file’s contents.
Unmount and disconnect the USB drive.
3 Work at the command prompt to create a directory in your home folder. In that
directory, use
touch to create four empty files named ipa1, ipa2, ipa123, and
ipa234. Determine the appropriate wildcards to use with
ls to list ipa1 and ipa123
but not the other files. Use those same wildcards with the
rm command to delete just
those two files. Confirm that the other files exist. Delete the remaining files and the
directory.
346 CompTIA Linux+ Certification, Powered by LPI

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required