LPI Linux Essentials Certificate, version 1.6 010-160 Exam Practice Test

Page: 1 / 14
Total 81 questions
Question 1

Which of the following commands will search for the file foo.txt under the directory /home?



Answer : D

The correct command to search for the file foo.txt under the directory /home is find /home --name foo.txt. This command uses the find command, which is used to search for files and directories that match certain criteria. The first argument, /home, specifies the starting point of the search. The second argument, -name, indicates that the search is based on the name of the file or directory. The third argument, foo.txt, is the name of the file to be searched for. The find command will recursively search all the subdirectories under /home and print the path of any file or directory that matches the name foo.txt.

The other commands are incorrect for various reasons:

A . search /home --file foo.txt is incorrect because there is no such command as search in Linux. The correct command for searching files and directories is find.

B . search /home foo.txt is incorrect because, as mentioned above, there is no search command in Linux. Also, this command does not use any option to specify the search criteria, such as -name, -type, -size, etc.

C . find /home -- file foo.txt is incorrect because the option -file is not valid. The correct option for specifying the type of file or directory is -type, followed by a letter that indicates the type, such as f for regular file, d for directory, l for symbolic link, etc. For example, find /home -type f -name foo.txt would search for a regular file named foo.txt under /home.

E . find /home foo.txt is incorrect because this command does not use any option to specify the search criteria, such as -name, -type, -size, etc. This command will search for any file or directory that has foo.txt as part of its name, not exactly as its name. For example, this command will also match a file named barfoo.txt or a directory named foo.txt.bak.


Question 2

What happens to a file residing outside the home directory when the file owner's account is deleted? (Choose two.)



Answer : C, E

When a user account is deleted, the files owned by that user are not automatically deleted from the file system, unless they are in the user's home directory. The files residing outside the home directory will remain unchanged, but they will have an invalid owner. The owner of a file is identified by a numeric user ID (UID), which is mapped to a user name by the /etc/passwd file. When a user is deleted, the corresponding entry in the /etc/passwd file is removed, but the UID of the file is not changed. Therefore, when listing the file's details, the UID of the former owner is shown instead of the user name. For example, if the user alice with UID 1001 is deleted, and she owns a file named report.txt in the /tmp directory, the output of ls -l /tmp/report.txt will look something like this:

-rw-r--r-- 1 1001 users 1024 Nov 20 14:11 /tmp/report.txt

The user root is not set as the new owner of the file, nor is the file moved to /lost+found or removed from the file system. The /lost+found directory is used to store files that are recovered from a corrupted file system after running the fsck command, not from deleted user accounts. The file system check does not affect the ownership or permissions of the files, unless there is a serious inconsistency that needs to be fixed.Reference:

Linux Essentials - Linux Professional Institute (LPI), section 5.2.1

5.2 Lesson 1 - Linux Professional Institute Certification Programs, slide 6.


Question 3

What is the preferred source for the installation of new applications in a Linux based operating system?



Answer : C

The distribution's package repository is the preferred source for the installation of new applications in a Linux based operating system. A package repository is a collection of software packages that are maintained by the distribution and can be easily installed, updated, or removed using a package manager. Package repositories offer several advantages, such as:

They ensure compatibility and stability with the system and other packages.

They provide security updates and bug fixes for the packages.

They reduce the risk of malware or corrupted files.

They simplify the dependency management and configuration of the packages.

The other sources are not preferred because they may not offer these benefits and may cause problems with the system. The vendor's version management system, the vendor's website, or a CD-ROM disk may contain packages that are not compatible with the distribution or may conflict with other packages. A retail store may not have the latest or the most suitable packages for the system.Reference:

Linux Essentials - Linux Professional Institute (LPI), section 1.3 Installing, Updating and Removing Software Packages

LPI Linux Essentials Study Guide: Exam 010 v1.6, 3rd Edition, chapter 4 Working on the Command Line, section 4.2 Managing Software

Table of Contents - Linux Professional Institute Certification Programs, section 1.3 Installing, Updating and Removing Software Packages


Question 4

Which of the following commands extracts the contents of the compressed archive file1.tar.gz?



Answer : C

The correct command to extract the contents of the compressed archive file1.tar.gz istar -xzf file1.tar.gz. This command uses the following options:

-xmeans extract files from an archive.

-zmeans filter the archive through gzip, which is a compression program that reduces the size of files.

-fmeans use the following archive file name, which is file1.tar.gz in this case.

The other commands are incorrect for the following reasons:

tar -czf file1.tar.gzcreates a compressed archive file1.tar.gz from the files specified after the command, not extract it.

ztar file1.tar.gzis not a valid command, as ztar is not a standard program or option for tar.

tar --extract file1.tar.gzis missing the-zoption to handle the gzip compression, and also the-foption to specify the file name.

detar file1.tar.gzis not a valid command, as detar is not a standard program or option for tar.


Linux Essentials - Topic 106: The Linux Operating System, section 106.2 Use single shell commands and one line command sequences to perform basic tasks on the command line.

LPI Linux Essentials Study Guide: Exam 010 v1.6, 3rd Edition, Chapter 5: Working with Files and Directories, section Compressing and Archiving Files.

Question 5

Where is the operating system of a Raspberry Pi stored?



Answer : C

The Raspberry Pi uses an SD card (or microSD card for newer models) as its main storage device. This means that the operating system and any other files are stored on the SD card, which can be easily inserted or removed from the Raspberry Pi. The SD card also allows the user to switch between different operating systems by using different cards or partitions. The Raspberry Pi does not have any internal storage, such as a hard disk drive or a solid state drive, nor does it use any external devices, such as an IDE bus, a firmware partition, or a GPIO module, to store the operating system.Reference:

Raspberry Pi OS -- Raspberry Pi

Choosing Storage for Raspberry Pi - Kingston Technology

Beginner's Guide: How To Install a New OS on Raspberry Pi


Question 6

Which of the following directories must be mounted with read and write access if it resides on its own dedicated file system?



Question 7

What is true about the dmesg command? (Choose two correct answers.)



Answer : C, E

The dmesg command is used to display the messages from the kernel that are stored in a ring buffer. A ring buffer is a fixed-size data structure that overwrites the oldest entries when it is full. Therefore, the dmesg command might not display older information because it was overwritten by newer information. The dmesg command is useful for troubleshooting system issues and checking hardware information. The dmesg command is not used to trace the execution of a command, send messages to user sessions, or output the system journal. Those functions are performed by other commands such as strace, write, and journalctl respectively.Reference: : [dmesg] : [Ring buffer] : [strace] : [write (Unix)] : [journalctl]4)


Page:    1 / 14   
Total 81 questions