LPI 010-160 Exam Dumps & Practice Test Questions
Question No 1:
Which of the following best describes the purpose of the /etc/passwd file in a Linux system?
A It stores the list of running processes and their current CPU usage.
B It contains user account information, including usernames and home directories.
C It holds configuration data for installed applications.
D It is used to manage hardware drivers and kernel modules.
Correct Answers: B
Explanation:
The /etc/passwd file is one of the most fundamental files in a Linux system for user management. It contains essential user account information that is used every time a user logs in or executes a command that involves user authentication. Each line in the file represents a single user account, and the fields in each line are separated by colons.
The typical format of a line in /etc/passwd looks like this:
username:x:UID:GID:comment:home_directory:default_shell
Here’s what each field represents:
username: The login name of the user.
x: A placeholder for the password field. The actual encrypted password is typically stored in /etc/shadow for security purposes.
UID: The User ID, a unique number assigned to each user.
GID: The Group ID, which identifies the primary group the user belongs to.
comment: A description field, often used for the full name or other user details.
home_directory: The absolute path to the user’s home directory.
default_shell: The shell that will be launched by default when the user logs in (e.g., /bin/bash).
Option A is incorrect because the list of running processes and their CPU usage is accessed through commands like top, ps, or from files in /proc, not from /etc/passwd.
Option C is inaccurate since configuration files for installed applications are typically stored in /etc but not in /etc/passwd. These configurations are usually found in their respective directories within /etc (for example, /etc/apache2/ for Apache).
Option D is also incorrect. Kernel modules and drivers are handled by tools like modprobe and files under /lib/modules/ or /etc/modprobe.d/, not /etc/passwd.
Therefore, the correct and most accurate answer is B, as it directly relates to the purpose of the /etc/passwd file in storing user account details, including the user’s home directory and default shell. This file is a cornerstone of Linux user management and is read by many system utilities to identify and manage users.
Question No 2:
Which three of the following options are commonly provided by public cloud service providers?
A Platform as a Service (PaaS)
B Infrastructure as a Service (IaaS)
C Internet as a Service (IaaS)
D Graphics as a Service (GaaS)
E Software as a Service (SaaS)
Correct Answers: A B E
Explanation:
Public cloud providers offer a variety of services that fall into several major categories, with the most widely adopted being Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS). Each of these serves different purposes in the deployment and use of computing resources over the internet.
Infrastructure as a Service, or IaaS, provides customers with basic computing infrastructure, such as virtual machines, storage, and networking capabilities. This allows businesses to run applications and store data without needing to invest in physical hardware. Instead, they can rent these resources on a pay-as-you-go model, scaling as needed. IaaS is especially valuable for developers and system administrators who need full control over operating systems and installed software.
Platform as a Service, or PaaS, provides a managed environment for developing, testing, and deploying applications. This means developers can focus on writing code without worrying about managing the underlying infrastructure, such as servers, operating systems, or runtime environments. The cloud provider handles the maintenance, patching, and scalability aspects. PaaS is often used for web application development due to its flexibility and time-saving benefits.
Software as a Service, or SaaS, delivers software applications directly to users over the internet. These are fully functional applications hosted in the cloud, accessed via web browsers. Common examples include email platforms, office suites, and customer relationship management tools. SaaS eliminates the need for users to install, maintain, or update software locally, which makes it highly convenient and cost-effective for organizations of all sizes.
Option C, Internet as a Service, is not a standard cloud computing model. Internet services are foundational to cloud access but are not offered as a cloud computing layer in the same sense as IaaS, PaaS, or SaaS.
Option D, Graphics as a Service, is not a broadly recognized category in cloud services. While some providers may offer virtualized GPU solutions for tasks like 3D rendering or machine learning, this is generally considered a subset of IaaS rather than a separate service type.
Question No 3:
Which of the following symbols in a shell prompt typically shows that the shell is operating with root user privileges?
A !
B #
C *
D &
E $
Correct Answers: B
Explanation:
In a Linux or Unix-like operating system, the command-line interface, commonly known as the shell, uses specific symbols in its prompt to indicate the current user's privilege level. These symbols can help users quickly identify whether they are operating as a regular user or as the system's superuser, known as root.
When a shell prompt ends with a dollar sign symbol, it usually indicates that the current user is a normal, non-privileged user. This is the most common scenario for day-to-day usage, where the user does not have access to critical system functions without elevated permissions.
On the other hand, when the prompt ends with a hash symbol, this is the system's way of showing that the shell is running under the root user account. The root user has full administrative privileges, including the ability to install or remove software, change system settings, create or delete users, and modify any file on the system. This level of access is powerful and potentially dangerous if commands are executed carelessly.
The hash symbol serves as a visual cue to proceed with caution. Commands executed with root privileges can significantly impact the entire system, including making it unstable or unbootable if used improperly.
Option A, the exclamation mark, is sometimes used in shell history expansions or scripting, but it does not represent user privilege in the prompt.
Option C, the asterisk, might appear in file listings or wildcard operations but does not indicate anything about user roles in the shell prompt.
Option D, the ampersand, is used to run commands in the background and is unrelated to user privilege levels.
Option E, the dollar sign, as mentioned earlier, typically represents a standard user shell session.
Therefore, the correct answer is B, as the hash symbol clearly denotes that the shell is operating with root-level privileges, a key distinction every Linux user should understand to avoid accidental system-wide changes.
Question No 4:
Which two commands can you use to learn how to properly use the ls command in a Linux system?
A option ls
B usage ls
C manual ls
D man ls
E info ls
Answer: D E
Explanation:
To understand how to use the ls command in Linux, there are standard help and documentation tools that provide both basic usage guidelines and detailed information. The two most commonly used commands for this purpose are man and info.
The man command, short for manual, is a widely used utility in Unix-like systems that displays the manual page for a specified command. When you type man ls, it pulls up the manual documentation specifically for the ls command. This includes a description of the command, a list of available options, usage examples, and any additional notes. These manual pages are grouped into sections and help users understand the complete structure and syntax of the command. It is particularly useful for experienced users or administrators who want quick access to technical documentation.
The info command is another documentation tool that provides even more detailed, structured, and hyperlinked information about commands. Typing info ls opens an interactive help file that not only explains what ls does but also allows users to navigate through different topics using links within the document. This command is helpful for beginners or those who want a more readable format than man pages, with the ability to explore related commands and topics.
The other options listed are incorrect because they are not valid commands in Linux. The option ls and usage ls commands do not exist in standard shell environments and will result in an error. Similarly, while manual ls may seem logical, it is not recognized by the system as a valid way to access command documentation. Only man and info are the proper utilities built into most Linux distributions for retrieving command usage details.
Therefore, to get thorough and official guidance on how to use the ls command correctly, man ls and info ls are the two appropriate and effective commands to use. They provide essential help to users at different levels of experience.
Question No 5:
Which statement correctly describes the behavior of a recursive directory listing?
A It includes the content of sub-directories.
B It includes the permissions of the directory listed.
C It includes details of file system internals, such as inodes.
D It includes ownership information for the files.
E It includes a preview of content for each file in the directory.
Correct Answer: A
Explanation:
A recursive directory listing refers to a command or operation that displays not just the contents of the specified directory but also the contents of all its sub-directories, going deeper into each level until all nested files and folders have been listed. This function is commonly performed using command-line tools like ls -R in Unix/Linux environments or dir /s in Windows.
When this recursive option is used, the system traverses each directory and every sub-directory beneath it, listing the contents found in each. This is particularly useful when users want a complete overview of all files and folders within a given directory tree. For example, if a directory named "Projects" contains three sub-folders, each with their own files and sub-sub-folders, a recursive listing would display everything—starting from the top-level directory down to the deepest file.
The primary focus of a recursive listing is the structure and contents of all included directories, not the metadata associated with each file unless additional options are specified.
Option B is incorrect because displaying permissions is a separate function that may be included with commands like ls -l, but is not inherently tied to recursion.
Option C is also incorrect since file system internals such as inodes are not revealed by a recursive listing unless specific flags or tools designed for that purpose are used.
Option D deals with file ownership, which again requires a long listing format or specialized tools and is not the defining feature of recursion.
Option E is incorrect because no standard recursive listing operation includes file content previews; such a feature would require file-specific commands like head, cat, or similar, applied individually to files.
Therefore, the most accurate description of a recursive directory listing is A.
Question No 6:
When attempting to remove the folder named Downloads using the command rm Downloads, the system returns an error message stating that it is a directory. Which of the following commands can be correctly used to delete the Downloads directory, assuming it is empty? (Select two options.)
A undir Downloads
B rmdir Downloads
C dir -r Downloads
D rem Downloads
E rm -r Downloads
Correct Answers: B, E
Explanation:
When trying to delete a directory using the command rm followed by the directory name, a common error occurs: "rm: cannot remove 'Downloads/': Is a directory." This message is the system’s way of indicating that the rm command, by itself, is not designed to remove directories. By default, rm is used to delete files, not folders. To delete a folder, either additional options must be provided or a different command must be used entirely.
The rmdir command is specifically designed to remove empty directories. It works only if the directory has no files or subfolders inside. In the case of the Downloads directory being empty, the command rmdir Downloads will work as expected, making B a correct answer.
Another valid way to remove a directory, whether empty or not, is to use the rm command with the recursive option, denoted as -r. The command rm -r Downloads instructs the system to remove the Downloads directory and everything inside it, even if it contains files or other subdirectories. However, since the question specifies that the directory is empty, the recursive option will still function properly. This makes E another correct answer.
Option A is incorrect because there is no such command as undir in Unix or Linux systems. Option C is invalid since dir -r is not a standard Linux command for removing directories; dir is used for listing directories, and the -r option does not exist for it. Option D, rem, is not a valid Unix command either. It is often seen in Windows batch scripting to add comments and has nothing to do with file or directory manipulation.
Question No 7:
Which directory is commonly used to store documentation, informational content, and sample configuration files related to software packages installed on a Linux system?
A /usr/share/doc/
B /etc/defaults/
C /var/info/
D /doc/
E /usr/examples/
Correct Answer: A
Explanation:
In Linux and other Unix-like operating systems, software packages often come with documentation and examples that help users understand how to use or configure the software. This type of informational content is typically stored in a standardized directory structure to maintain organization and ease of access. The directory that serves this purpose most commonly is /usr/share/doc/.
The /usr/share/doc/ directory contains subdirectories for each installed package. Within each subdirectory, users can find materials such as README files, changelogs, license information, manuals, and example configuration files. These files are intended to guide administrators and users in understanding the installed package, its purpose, and how to properly configure it.
This directory is part of the broader /usr/share/ hierarchy, which is used for architecture-independent data shared among packages. Since documentation is typically the same regardless of hardware architecture, it is stored here to prevent redundancy and improve consistency across systems.
Option B, /etc/defaults/, is incorrect because this directory typically holds default configuration files for services, especially in systems like Debian or Ubuntu. These files are more directly tied to service behavior and not general documentation.
Option C, /var/info/, is not a standard directory in Linux file system hierarchy and does not serve a recognized purpose in most distributions.
Option D, /doc/, is not a standard top-level directory in Linux and may not even exist unless manually created. Documentation is not usually placed here.
Option E, /usr/examples/, is also not a standard directory. While example files may be found in some systems, the more consistent and widely used location is /usr/share/doc/.
Therefore, /usr/share/doc/ is the most accurate and appropriate directory that aligns with the typical Linux filesystem standard for storing package-related documentation and examples.
Question No 8:
Which of the following commands correctly appends the directory /new/dir/ to the existing PATH environment variable?
A $PATH=/new/dir: $PATH
B PATH=/new/dir: PATH
C export PATH=/new/dir: PATH
D export $PATH=/new/dir: $PATH
E export PATH=/new/dir:$PATH
Correct Answers: E
Explanation:
In Linux and Unix-like systems, the PATH environment variable plays a vital role in determining how commands are located and executed. It stores a list of directories that the shell searches when a user enters a command. When you type a command such as ls or nano, the shell looks through the directories listed in the PATH to find the appropriate executable file.
To add a new directory to the PATH, you must update it in a way that preserves the existing values. This is done by appending the current PATH value after the new directory using a colon as a separator. The export command is then used to ensure that the change is reflected in the environment of the shell and its child processes.
The correct syntax is:
export PATH=/new/dir:$PATH
This command tells the shell to prepend /new/dir to the existing PATH, followed by the current PATH content. This means the system will look in /new/dir first when trying to find executables, which can be useful if you want your custom or newly installed binaries to take precedence over system defaults.
Now let's look at why the other options are incorrect:
A tries to assign a value to $PATH directly, but variable names should not have a dollar sign when being assigned. The dollar sign is used to reference the variable, not to assign it.
B lacks the export keyword, which means the change will apply only to the current shell and won’t be available to subprocesses.
C is close but references PATH as a literal string, not its current value. Without the dollar sign, it does not include the existing PATH contents, so it will overwrite it completely.
D incorrectly uses $PATH on the left-hand side of the assignment. You cannot assign to $PATH; it must be PATH without the dollar sign.
Therefore, the correct and fully functional command is shown in option E, which appends the new directory to the existing PATH while making the change available to child processes through export.
Question No 9:
A user is working within the /home/user/Downloads/ directory and executes the command ls ../Documents/. If the specified directory exists, which directory’s contents will be shown?
A /home/user/Documents/
B /home/user/Documents/Downloads/
C /home/user/Downloads/Documents/
D /Documents/
E /home/Documents
Correct Answers: A
Explanation:
To determine which directory's contents are listed when the command ls ../Documents/ is executed, it's important to understand how relative paths work in Linux file systems. The ls command is used to list directory contents. The syntax ../ means "go up one level from the current directory."
In this case, the user is located in /home/user/Downloads/. The double dots (..) refer to the parent directory of Downloads, which is /home/user/. When the command includes ../Documents/, it tells the system to first go up from Downloads to /home/user/ and then enter the Documents directory found there.
So, the command ls ../Documents/ translates to listing the contents of /home/user/Documents/, assuming that the Documents directory exists under /home/user/. The output will show the files and subdirectories stored within that specific path.
Option A is correct because /home/user/Documents/ is the destination reached by moving up one level from /home/user/Downloads/ and then into Documents.
Option B is incorrect because /home/user/Documents/Downloads/ would require starting in Documents, then going into Downloads, which is the reverse of what the command specifies.
Option C is incorrect because /home/user/Downloads/Documents/ implies that there is a Documents directory inside Downloads, which is not what ../Documents/ would access. That would require just ls Documents/ without the ../ prefix if such a directory existed.
Option D is not correct because /Documents/ refers to a top-level directory directly under the root (/) of the file system. The command does not indicate any absolute path like this.
Option E is incorrect because /home/Documents suggests a Documents folder located directly inside /home/, not under /home/user/, and the relative path used does not access that directory.
Therefore, based on standard directory traversal, the correct directory being referenced and listed is /home/user/Documents/.
Question No 10:
Given a directory with the files named texts 1.txt, texts 2.txt, and texts 3.csv, which command will correctly copy both .txt files to the /tmp/ directory?
A cp ??.txt /tmp/
B cp *.txt /tmp/
C cp ..txt /tmp/
D cp ?.txt /tmp/
E cp $?.txt /tmp/
Correct Answer: B
Explanation:
The command that best suits the requirement of copying all files that end with the .txt extension to the /tmp/ directory is cp *.txt /tmp/. In this case, the asterisk (*) is used as a wildcard in Unix-like shells to represent any number of characters in a filename. So, *.txt means all files that have any name ending with .txt. In the example given, the files texts 1.txt and texts 2.txt both meet this pattern, while texts 3.csv does not, since its extension is different. Therefore, using this command ensures that both .txt files will be copied, and the .csv file will be ignored.
Option A uses ??.txt, which attempts to match filenames that have exactly two characters before the .txt extension. This would not match texts 1.txt or texts 2.txt because they contain more than two characters before .txt.
Option C is invalid syntax. The pattern .\.txt would not work in Unix-like environments. It resembles a regular expression rather than a valid shell globbing pattern and would not match any files unless they were literally named .txt.
Option D uses ?.txt, which matches only filenames with a single character before the .txt extension. That also does not match either texts 1.txt or texts 2.txt.
Option E tries to use $?.txt, where $? is a shell variable that holds the exit status of the last command. This will result in something like cp 0.txt /tmp/, which is clearly incorrect and unrelated to the actual file names.
Thus, the only correct and functional option is B, which uses the wildcard * appropriately to include all files with names ending in .txt, matching both of the intended files.