Which of the following is a characteristic of a hard link?
Works across volumes and file systems.
Distinct (non-duplicate) inode.
Lowercase L (l) as the first character in the permission string.
Valid inode for the file data even if the original file is deleted.
What is Valid inode for the file data even if the original file is deleted.
Explanation
A hard link maintains a valid inode for the file data even if the original file is deleted.
A hard link has a duplicate inode.
A hard link must be on the same partition and do not work across volumes and file systems.
A hard links has a dash as the first character in the permission string (example: -rwxrwxrwx).
References
TestOut Linux Pro 5.0 - 2.10 Links
Which of the following utilities would you use to search a path for files that match a given name?
tail
locate
type
cat
What is locate
Explanation
The locate utility searches a path for filenames that match a given name.
The type command displays the category of the command.
The cat command displays the contents of a file in the shell.
The tail command lists the last 10 lines of a specified file by default.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
Which of the following commands would display this output?
Frank said, "Linux is fun!"
echo Frank said, "Linux is fun\!"
echo Frank said, \"Linux is fun\!\"
echo "Frank said," "Linux is fun!"
echo Frank said, "Linux is fun!"
What is echo Frank said, \"Linux is fun\!\"
Explanation
echo Frank said, \"Linux is fun\!\" will display 'Frank said, "Linux is fun!"' The " and ! must be escaped to display correctly.
The other options will not produce the desired results.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
What is the full path to the directory that contains user data for all standard users on the system?
What is /home
Explanation
The /home directory contains the user data for all users on the Linux system except for the root user account. When you plan partitions, you should create a separate partition for the /home directory.
References
TestOut Linux Pro 5.0 - 3.1 Linux System Design
Which of the following paths represents the root directory?
/
/root
/boot/home/root
Explanation
The forward slash (/) character represents the root filesystem of the Linux system.
The /root directory is the root user's home directory. Do not confuse /root with the root filesystem (/).
The /home/root directory does not exist. The /home directory contains all users' home directories except for the root user.
The /boot directory contains the kernel and boot loader files.
References
TestOut Linux Pro 5.0 - 2.11 Filesystem Hierarchy Standard (FHS)
Which of the following commands is used to find a specific file on a Linux system? (Select TWO. Each answer represents an independent solution.)
type
find
locate
whereis
which
What is locate and find
Explanation
The find or locate command is used to search through a file system. Find searches through the files based on the file system by name, file size, time created, and other options. The locate utility is much faster than find and searches /var/log/locatedb as the index file.
The whereis command displays the path to the binary files, the manual pages, and the source code.
The which command displays the path to a command and determines whether a package is installed.
The type command displays the category of the command.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
Which of the following is a valid metacharacter that can be used in the bash shell to escape or ignore the shell's special meaning for the character that immediately follows?
{}
;
*
\
What is the \
Explanation
To escape a character, you put a backslash (\) in front of it so that anything that follows the \ is treated like a regular character, not a metacharacter.
*, {}, and ; do not escape characters, but are each metacharacters with a specific function.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
You have a Linux system with 8 GB of RAM installed. You plan to use this system as a server.
How much space should you plan to partition for the swap file?
16 GB
4 GB
8 GB
12 GB
What is 8GB
Explanation
The recommended size of the swap partition on a Linux server system is one time the amount of installed RAM. In this case, the system has 8 GB of RAM, so 8 GB is the recommended size for the swap partition. Linux can use either a swap file or a swap partition for the swap area. Whenever possible, create a separate swap partition.
The recommended size of the swap partition on a Linux desktop system is two times the amount of installed RAM. If the desktop system has 8 GB of RAM, the recommended size for the swap partition is 16 GB.
References
TestOut Linux Pro 5.0 - 3.1 Linux System Design
According to the Filesystem Hierarchy Standard (FHS), which of the following directories contains information about the system state and processes?
/root
/bin
/proc
/tmp
What is /proc
Explanation
Under the Filesystem Hierarchy Standard (FHS), the /proc directory contains information about the system state and processes. The Filesystem Hierarchy Standard (FHS) governs the unified file system for Linux systems by defining a standard set of directories, subdirectories, and files.
The /root directory is the root user's home directory. Do not confuse /root with the root of the system (/).
The /bin directory contains binary commands that are available to all users.
The /tmp directory contains temporary files created by programs during system use.
References
TestOut Linux Pro 5.0 - 2.11 Filesystem Hierarchy Standard (FHS)
Which of the following commands displays all lines within the MTS file that have the word "world" within them?
grep MTS world
grep world MTS
find MTS world
find world MTS
What is grep world MTS command searches for lines in the MTS file that contains the word "world".
Explanation
The grep world MTS command searches for lines in the MTS file that contains the word "world".
The grep MTS world command searches for lines in the world file that contains the word "MTS".
The find MTS world command attempts to find the MTS and world files in the current directory.
The find world MTS command attempts to find the world and MTS files in the current directory.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
Which of the following commands will display each line in a text file in alphabetic order?
tr
uniq
sort
split
What is sort
Explanation
The sort command will sort each line of text in a file or from a text stream alphabetically. The following options can be used:
-b ignores leading blank spaces.
-d uses the first alpha-numeric character and ignores special characters.
-f ignores case.
-M sorts by month.
-n sorts according to the string numeric value.
-r reverses the sort order.
The split command splits lines of text from a file or a text stream into segments of a specified number of lines.
The uniq command filters identical lines from a file.
The tr transposes characters in a text stream.
References
TestOut Linux Pro 5.0 - 2.13 Text Stream Processing
You are installing Linux on an old computer with an old BIOS, and you are planning the partitions for the hard disk drive.
Which of the following directories SHOULD exist in the first 1024 cylinders of the hard disk drive?
/home
/var
/boot
/bin
What is /boot
Explanation
The /boot partition must be completely within the first 1,024 cylinders on systems with older BIOS versions. This is because the disk is used via the BIOS during boot and BIOS can't handle more than 1,024 cylinders. Newer versions of the BIOS can handle disks with more than 1,024 cylinders.
References
TestOut Linux Pro 5.0 - 3.1 Linux System Design
Which of the following directories is the home directory for the root user account?
/root
/
/home/root
/home
Explanation
The /root directory is the home directory for the root user account. Do not confuse /root with the root of the system (/).
The root of the system (/) represents the base of all directories governed by the Filesystem Hierarchy Standard (FHS).
The /home directory contains the user home directories by default.
The /home/root directory is not a valid home directory for the root users. Standard user accounts will have /home/username as their home directory.
References
TestOut Linux Pro 5.0 - 2.11 Filesystem Hierarchy Standard (FHS)
Which of the following commands displays all the lines in the blue_and_gold file that do not contain the word 'Karen'?
grep -v blue_and_gold Karen
grep -n Karen blue_and_gold
grep -n blue_and_gold Karen
grep -v Karen blue_and_gold
What is grep -v Karen blue_and_gold command displays all the lines in the blue_and_gold file that do not contain the word "Karen".
Explanation
The grep -v Karen blue_and_gold command displays all the lines in the blue_and_gold file that do not contain the word "Karen".
The grep -n blue_and_gold Karen command displays all the lines prefixed with the line number in the Karen file (if it exists) that contains the words "blue_and_gold".
The grep -n Karen blue_and_gold command displays all the lines prefixed with the line number in the blue_and_gold file that do contain the word "Karen".
The grep -v blue_and_gold Karen command displays all the lines in the Karen file (if it exists) that do not contain the words "blue_and_gold".
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
Which of the following commands merges two files on a line-by-line basis and separate each line with a tab?
pr
join
paste
od
What is paste
Explanation
The paste command adds the contents of one file to the contents of another file on a line-by-line basis. The -d option specifies the character to place between the conjoined lines of each file. The default is a tab.
The join command combines text from two files based on fields with identical text and sends the result to standard output.
The pr command formats a text file for printing.
The od command displays the contents of any file in octal, decimal, hexadecimal, or character format.
References
TestOut Linux Pro 5.0 - 2.13 Text Stream Processing
For which of the following directories should you create separate partitions? (Select TWO).
/bin
/var
/lib
/home
What is /var and /home
Explanation
When planning the partitions on the Linux system, consider creating separate partitions for the following directories:
/home contains by default the user home directories.
This can help prevent a system crash if the users fill the entire partition with their files.
/var contains data files that change constantly.
This can help prevent a system crash if the log files fill the entire partition.
The following are other partitions that you may want to install on their own partition:
/boot contains the kernel and boot loader files.
/opt contains the additional programs on the system.
/tmp contains temporary files created by programs during system use.
/usr contains system commands and utilities.
The /bin directory contains binary commands that are available to all users and most likely will not fill a partition.
The /lib directory contains shared program libraries and kernel modules.
Both /bin and /lib should be located on the root partition.
References
TestOut Linux Pro 5.0 - 3.2 Linux Installation
Which of the following commands finds files with the .txt extension in the /home/gshant directory?
find /home/gshant -name '*.txt'
find /home/gshant -name '*txt*'
find /home/gshant -type d -name '*text*'
find /home/gshant -type f -name '*text*'
What is find /home/gshant -name '*.txt'
Explanation
The find /home/gshant -name '*.txt' command finds all files with the .txt extension in the /home/gshant directory. Use the find command to search through all files based on the file system by name, file size, time created, and other options:
-name locates a file or directory by name in a specific path. When using -name:
Enclose name strings in single quotes.
Use wildcards for partial names.
Use -iname for case insensitive.
-user finds files owned by a specific user.
-size finds files of a specific size.
-mtime finds files last modified before or after a specified number of days ago.
-type [fd] specifies whether to find files or directories.
-maxdepth specifies how many levels down to search.
-print0 finds filenames with spaces.
The find /home/gshant -name '*txt*' command finds all the files that have the characters 'txt' somewhere in the name of the file.
The find /home/gshant -type f -name '*text*' command finds only files that have the characters 'text' somewhere in the name of the file.
The find /home/gshant -type d -name '*text*' command finds only directories that have the characters 'text' somewhere in the name of the file.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
Which of the following commands finds all of the files on the system that have either blue or gold in their names?
find .. -name '*blue*' -o '*gold*'
find .. -print0 '*blue*' -o '*gold*'
find . -name '*blue*' -o -name '*gold*'
find / -name '*blue*' -o -name '*gold*'
What is find / -name '*blue*' -o -name '*gold*'
Explanation
The -name option must be used with find to locate a file based on its name. The default action with the find utility is to print, and this option need not be specified.
To search the whole file system (that is, the root of the file system), begin the search from '/'.
Use -o to use the or operator when searching with multiple criteria.
To search the current directory and subdirectories, begin the search from '.'.
To search the parent directory and subdirectories, begin the search from '..'.
References
TestOut Linux Pro 5.0 - 2.12 Locating and Searching Files
Which of the following utilities will substitute an existing string with a new string within a file?
fgrep
grep
sed
egrep
What is sed
Explanation
The sed command takes text as input and modifies the text document named in the command line. The sed s option replaces the text behind the first forward slash (/) with the text behind the second forward slash (/).
The grep command searches through files for a specified character string.
The fgrep command searches for fixed strings rather than regular expressions.
The egrep command uses regular expressions in the search strings.
References
TestOut Linux Pro 5.0 - 2.13 Text Stream Processing
Which of the following partitions functions as virtual memory for a Linux system?
swap
/var
/srv
/
What is swap
Explanation
The swap partition functions as virtual memory for your Linux system. It allows the system to use more memory than it physically has installed.
/ is the root partition and is required to boot a Linux system. It is mounted at the root of the Linux file system.
The /srv partition contains files for services such as HTTP and FTP servers.
The /var partition contains data files that change constantly, such as:
User mailboxes
Print queues
Log files
References
TestOut Linux Pro 5.0 - 3.2 Linux Installation