Chapter-2 (File Management)
Chapter-2 (File Management)
Chapter-2 (File Management)
programs?
A. /usr/bin
B. /usr
C. /opt
D. /usr/sbin
E. /tmp
ANSWER: C
You are looking at a directory that you have not viewed in a long time and need to
determine which files are actually directories. Which command is the best one to
use?
A. mkdir -v
B. ls
C. ls -F
D. ls -i
E. ll
ANSWER: C
You are using the ls command to look at a directory file’s metadata but keep seeing
metadata for the files within it instead. What command option will rectify this
situation?
A. -a
B. -d
C. -F
D. -l
E. -R
ANSWER: B
You have just created an empty directory called MyDir. Which command most likely
did you use?
A. mkdir -v MyDir
B. touch MyDir
C. cp -R TheDir MyDir
D. mv -r TheDir MyDir
E. rmdir MyDir
ANSWER: A
A long-time server administrator has left the company, and now you are in charge of
her system. Her old user account directory tree, /home/Zoe/, has been backed up.
Which command is the best one to use to quickly remove her files?
A. cp -R /home/Zoe/ /dev/null/
B. mv -R /home/zoe/ /dev/null/
C. rm -Rf /home/Zoe/
D. rm -ri /home/Zoe/
E. rm -rI /home/Zoe
ANSWER: E
Which directory contains dynamic configuration data, such as FTP and websites?
A. /var
B. /usr
C. /tmp
D. /run
ANSWER: A
Under which directory would you expect to find nonessential program files?
A. /boot
B. /bin
C. /sbin
D. /usr
ANSWER: D
Which command enables you to show all files in the current directory so that the
newest files are listed last?
A. ls -lRt
B. ls -lrt
C. ls -alrt
D. ls -alr
ANSWER: C
Which command enables you to copy hidden files as well as regular files from /home/
$USER to the current directory?
A. cp -a /home/$USER .
B. cp -a /home/$USER/* .
C. cp -a /home/$USER/. .
D. cp -a home/$USER. .
ANSWER: C
The _________ command displays the full path name of the current location.
A. cd
B. ls
C. pwd
D. touch
ANSWER: C
A/An _________ is a fully qualified name, beginning at the root (/) directory and
specifying each subdirectory traversed to reach and uniquely represent a single
file.
A. absolute path
B. relative path
C. pwd
D. none of the above
ANSWER: A
A/An _________ identifies a unique file, specifying only the path necessary to
reach the file from the working directory.
A. absolute path
B. relative path
C. pwd
D. none of the above
ANSWER: B
Which command enables you to list the current user's home directory (long format)
in simplest syntax, when it is not the current location.
A. ls -l ~
B. ls -al
C. ls -cl
D. ls -il
ANSWER: A
Which command enables you to list the current location (long format) with hidden
files.
A. ls -l ~
B. ls -al
C. ls -cl
D. ls -il
ANSWER: B
Which command enables you to show the contents of the current directory, in
addition to all of its subdirectories.
A. ls -l
B. ls -a
C. ls -d
D. ls -R
ANSWER: D
Which command enables you to return to the current user's home directory.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: D
Which command enables you to return to the most previous working directory.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: A
Which command enables you to move up two levels from the current location.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: C
Which command enables you to move up to the parent of the current location.
A. cd -
B. cd ..
C. cd ../..
D. cd
ANSWER: B
Which command enables you to move to the binaries location, from any current
location.
A. cd /bin
B. cd bin
C. cd
D. cd .
ANSWER: A
Which command enables you to move to the binaries location, from the root
directory.
A. cd /bin
B. cd bin
C. cd
D. cd .
ANSWER: B
The _________ command renames files in the same directory, or relocates files to a
new directory.
A. ren
B. rm
C. rn
D. mv
ANSWER: D
What command enables you to display a list of current directory contents, where the
newest files are listed first?
A. ls -lRt
B. ls -lrt
C. ls -alrt
D. ls -alt
ANSWER: D
Which command enables you to wipe an entire directory structure, including all of
its contents?
A. rm -i /directory
B. rm -d /directory
C. rm -rf /directory
D. rm /directory
ANSWER: C
How would you copy all files that have a name that starts with a, b, or c from the
directory /etc to your current directory?
A. cp /etc/[abc]* .
B. cp /etc/[abc]? .
C. cp /etc/[abc]? ~
D. cp /etc/[abc]* ~
ANSWER: A