PDF Download Free of 010-160 Valid Practice Test Questions [Q48-Q73]

Share

PDF Download Free of 010-160 Valid Practice Test Questions

010-160 Test Engine files, 010-160 Dumps PDF


Lpi 010-160 certification exam is an entry-level certification exam that is designed to test the knowledge and skills of individuals who are interested in pursuing a career in Linux. 010-160 exam covers a wide range of topics that are essential for anyone who wants to work with Linux operating systems, including basic commands, filesystems, networking, security, and more.

 

NEW QUESTION # 48
The file script.sh in the current directory contains the following content:
#!/bin/bash echo $MYVAR
The following commands are used to execute this script:
MYVAR=value
./script.sh
The result is an empty line instead of the content of the variable MYVAR. How should MYVAR be set in order to make script.sh display the content of MYVAR?

  • A. $MYVAR=value
  • B. MYVAR=value
  • C. !MYVAR=value
  • D. export MYVAR=value
  • E. env MYVAR=value

Answer: D

Explanation:
Explanation
The reason why the script.sh does not display the content of the variable MYVAR is that the variable is not exported to the environment of the script. When a script is executed, it runs in a separate process that inherits the environment variables from the parent process, but not the shell variables. A shell variable is a variable that is defined and visible only in the current shell session, while an environment variable is a variable that is exported to the environment and visible to all processes that run in that environment1.
To make a shell variable an environment variable, we need to use the export command. The export command takes a shell variable name and adds it to the environment of the current shell and any subshells or processes that are created from it2. For example, to export the variable MYVAR with the value value, we can use:
export MYVAR=value
This will make the variable MYVAR available to the script.sh when it is executed, and the script will print the value of MYVAR as expected. Alternatively, we can also use the export command with the -n option to remove a variable from the environment, or with the -p option to list all the environment variables2.
The other options are not valid ways to set MYVAR as an environment variable. The !MYVAR=value option is not a valid syntax for setting a variable in bash. The env MYVAR=value option will run the env command with the MYVAR=value argument, which will print the environment variables with the addition of MYVAR=value, but it will not affect the current shell or the script.sh3. The MYVAR=value option will set MYVAR as a shell variable, but not as an environment variable, so it will not be visible to the script.sh1. The
$MYVAR=value option will try to set the variable whose name is the value of MYVAR to the value value, which is not what we want4. References:
* Linux Essentials Exam Objectives, Version 1.6, Topic 103.1, Weight 2
* Linux Essentials Certification Guide, Chapter 3, Page 51-52
* env(1) - Linux manual page
* Bash Variables - LinuxConfig.org


NEW QUESTION # 49
What can be found in the /proc/ directory?

  • A. One directory per installed program.
  • B. One device file per hardware device.
  • C. One log file per running service.
  • D. One directory per running process.
  • E. One file per existing user account.

Answer: D

Explanation:
Explanation
The /proc/ directory is a virtual file system that contains information about the system and the processes running on it. It is not a conventional file system that stores files on a disk, but rather a dynamic view of the kernel's data structures. One of the features of the /proc/ directory is that it contains one subdirectory for each process running on the system, which is named after the process ID (PID). For example, the subdirectory
/proc/1/ contains information about the process with PID 1, which is usually the init process. The process subdirectories contain various files that provide information about the process, such as its status, memory usage, open files, environment variables, command line arguments, and more. The /proc/ directory also contains a symbolic link called 'self', whichpoints to the process that is accessing the /proc/ file system.
Therefore, the correct answer is D. One directory per running process.
The other options are incorrect because:
* A. One directory per installed program. This is not true, as the /proc/ directory does not contain information about installed programs, but only about running processes. Installed programs are usually stored in other directories, such as /bin/, /usr/bin/, /opt/, etc.
* B. One device file per hardware device. This is not true, as the /proc/ directory does not contain device files, but only virtual files that represent kernel data. Device files are usually stored in the /dev/
* directory, which is another special file system that provides access to hardware devices.
* C. One file per existing user account. This is not true, as the /proc/ directory does not contain information about user accounts, but only about processes. User accounts are usually stored in the /etc/ directory, which contains configuration files, such as /etc/passwd/ and /etc/shadow/, that define the users and their passwords.
* E. One log file per running service. This is not true, as the /proc/ directory does not contain log files, but only information files. Log files are usually stored in the /var/log/ directory, which contains various files that record the activities of the system and the services.
References:
* The /proc Filesystem - The Linux Kernel documentation
* A Beginner's Guide to the /proc File System in Linux - Tecmint
* Appendix E. The proc File System Red Hat Enterprise Linux 6 | Red Hat ...
* Chapter 5. The proc File System Red Hat Enterprise Linux 4 | Red Hat ...
* proc file system in Linux - GeeksforGeeks


NEW QUESTION # 50
Which of the following statements are true regarding a typical shell script? (Choose two.)

  • A. It is compiled into a binary file compatible with the current machine architecture.
  • B. It is located in /etc/bash/scripts/.
  • C. It is located in /usr/local/scripts/.
  • D. It starts with the two character sequence #!.
  • E. It has the executable permission bit set.

Answer: D,E

Explanation:
Explanation
A typical shell script is a text file that contains a series of commands or instructions that can be executed by a shell interpreter. A shell script usually has the executable permission bit set, which means that it can be run as a program by the user or another program. A shell script also starts with the two character sequence #!, which is called a shebang or a hashbang. This sequence tells the operating system which shell interpreter to use to run the script. For example, #!/bin/bash indicates that the script should be run by the bash shell. References:
* Linux Essentials - Linux Professional Institute (LPI) 1
* Linux Essentials - Linux Professional Institute Certification Programs 2


NEW QUESTION # 51
Which of the following commands can be used to resolve a DNS name to an IP address?

  • A. dns
  • B. host
  • C. dnsname
  • D. query
  • E. iplookup

Answer: B

Explanation:
Explanation
The host command is used to resolve a DNS name to an IP address or vice versa. It can also perform other DNS queries, such as finding the mail servers for a domain. The host command has the following syntax: host
[options] [name] [server]. The name argument can be a hostname, such as www.lpi.org, or an IP address, such as 192.168.0.1. The server argument is optional and specifies the name or IP address of the DNS server to query. If no server is given, the default system resolver is used. References:
* Linux Essentials Version 1.6 Objectives: 1.4.1. Demonstrate an understanding of the purpose and types of DNS records1
* Linux Essentials Version 1.6 Exam Study Resources: Linux Essentials Manual - Chapter 10. Network Fundamentals - 10.3. DNS and Hostname Resolution - 10.3.1. The host Command2
* Linux Essentials Version 1.6 Exam Study Resources: Linux Essentials Manual - Appendix A. Answers to the Exercises - Chapter 10. Network Fundamentals - 10.3. DNS and Hostname Resolution - Exercise
10.3.12


NEW QUESTION # 52
The current directory contains the following file:
-rw-r-r- 1 root exec 24551 Apr 2 12:36 test.sh
The file contains a valid shell script, but executing this file using ./test.sh leads to this error:
bash: ./test.sh: Permission denied
What should be done in order to successfully execute the script?

  • A. The script should be run using #!./test. sh instead of ./test.sh.
  • B. The user executing the script should be added to the exec group.
  • C. The execute bit should be set in the file's permissions.
  • D. The file's extension should be changed from .sh to .bin.
  • E. The SetUID bit should be set in the file's permissions

Answer: C

Explanation:
The execute bit in Linux is a permission bit that allows the user to run an executable file or enter a directory. For regular files, such as scripts or binaries, the execute bit must be set for the user to run them. For directories, the execute bit allows the user to access the files and subdirectories inside. Therefore, to successfully execute the script test.sh, the execute bit should be set in the file's permissions. This can be done by using the chmod command with the +x option, for example: chmod +x test.sh. The other options are either irrelevant or incorrect. The file's extension does not affect its executability, only its association with a program. The user executing the script does not need to be in the exec group, as long as the user has the execute permission on the file. The SetUID bit is a special permission bit that allows the user to run the file as the file's owner, regardless of the user's identity. This is not necessary for executing the script, and may pose a security risk. The #!./test.sh syntax is invalid, as the #! is used to specify the interpreter for the script, not the script itself. Reference:
Linux Essentials Version 1.6 Objectives1, Topic 1.4: Command Line Basics, Subtopic: Basic Shell Commands Linux Essentials Version 1.6 Exam Preparation Guide2, Section 1.4: Command Line Basics, Page 16 Execute vs Read bit. How do directory permissions in Linux work?3


NEW QUESTION # 53
Which of the following commands adds the directory /new/dir/ to the PATHenvironment variable?

  • A. export PATH=/new/dir: PATH
  • B. export $PATH=/new/dir: $PATH
  • C. PATH=/new/dir: PATH
  • D. export PATH=/new/dir: $PATH
  • E. $PATH=/new/dir: $PATH

Answer: D

Explanation:
Explanation/Reference:


NEW QUESTION # 54
Which of the following outputs comes from the commandfree?

  • A. Option D
  • B. Option A
  • C. Option C
  • D. Option B
  • E. Option E

Answer: E


NEW QUESTION # 55
What are the differences between a private web browser window and a regular web browser window? (Choose three.)

  • A. Private web browser windows do not store cookies persistently.
  • B. Private web browser windows do not keep records in the browser history.
  • C. Private web browser windows do not allow printing or storing websites.
  • D. Private web browser windows do not send regular stored cookies.
  • E. Private web browser windows do not support logins into websites.

Answer: A,B,D

Explanation:
Explanation
A private web browser window is a mode of browsing that prevents the browser from saving your browsing history, cookies, and other site data, or information entered in forms. However, it does not prevent websites, your employer or school, or your internet service provider from tracking your online activity. The main differences between a private web browser window and a regular web browser window are:
* Private web browser windows do not store cookies persistently. Cookies are small files that websites use to store information on your device, such as your preferences, login status, or tracking data. In a regular web browser window, cookies are stored until they expire or you delete them. In a private web browser window, cookies are deleted when you close all private windows.
* Private web browser windows do not keep records in the browser history. The browser history is a list of
* web pages that you have visited in the past. In a regular web browser window, the browser history is saved and can be accessed by anyone who uses the same device or profile. In a private web browser window, the browser history is not saved and cannot be viewed by anyone.
* Private web browser windows do not send regular stored cookies. When you visit a website in a regular web browser window, the browser sends any cookies that are stored for that website. This allows the website to recognize you and provide personalized content or services. When you visit a website in a private web browser window, the browser does not send any cookies that are stored in regular windows.
This prevents the website from identifying you or linking your activity across different sessions.
References: Browse in private - Computer - Google Chrome Help, Browse InPrivate in Microsoft Edge - Microsoft Support, Private Browsing: What Is It and How to Use It | Edge Learning Center


NEW QUESTION # 56
When typing a long command line at the shell, what can be used to split a command across multiple lines?

Answer:

Explanation:
\


NEW QUESTION # 57
Which of the following statements is true about Free Software?

  • A. It only runs on Linux.
  • B. It must always be available free of charge.
  • C. It may be modified by anyone using it.
  • D. It is only distributed as a compiled binary.
  • E. It is developed by volunteers only.

Answer: C

Explanation:
The correct statement about Free Software is that it may be modified by anyone using it. This is one of the four essential freedoms of Free Software, which are: the freedom to run the program as you wish, for any purpose; the freedom to study how the program works, and change it so it does your computing as you wish; the freedom to redistribute copies so you can help your neighbor; and the freedom to distribute copies of your modified versions to others1. Access to the source code is a precondition for these freedoms1.
The other statements are false for the following reasons:
Free Software is not developed by volunteers only. It can be developed by anyone, including individuals, companies, organizations, or communities. Some Free Software developers are paid for their work, while others do it as a hobby or for social benefit1.
Free Software does not have to be available free of charge. It can be sold or given away for any price. The term "free" refers to the users' freedom, not the price of the software1. However, Free Software users have the freedom to redistribute copies, so they can obtain the software at no charge from someone who has a copy1.
Free Software does not only run on Linux. It can run on any operating system that supports it, such as Windows, MacOS, BSD, or Android. Linux is an example of a Free Software operating system, but not the only one1.
Free Software is not only distributed as a compiled binary. It can also be distributed as source code, or both. In fact, Free Software must provide access to the source code, otherwise the users cannot study or modify the software1.
Reference:
What is Free Software? - GNU Project - Free Software Foundation


NEW QUESTION # 58
Which of the following commands adds thedirectory/new/dir/to thePATHenvironment variable?

  • A. export PATH=/new/dir: PATH
  • B. export $PATH=/new/dir: $PATH
  • C. PATH=/new/dir: PATH
  • D. export PATH=/new/dir: $PATH
  • E. $PATH=/new/dir: $PATH

Answer: D


NEW QUESTION # 59
Which of the following are typical services offered by public cloud providers? (Choose three.)

  • A. Graphics as a Service (GaaS)
  • B. Software as a Service (SaaS)
  • C. Platform as a Service(PaaS)
  • D. Infrastructure as a Service(IaaS)
  • E. Internet as a Service(IaaS)

Answer: B,C,D

Explanation:
Explanation/Reference:


NEW QUESTION # 60
Which of the following Linux Distributions is derived from Red Hat Enterprise Linux?

  • A. Raspbian
  • B. Ubuntu
  • C. CentOS
  • D. openSUSE
  • E. Debian

Answer: C


NEW QUESTION # 61
What parameter of ls prints a recursive listing of a directory's content? (Specify ONLY the option name without any values or parameters.)

Answer:

Explanation:
ls -R Explanation The -R parameter of the ls command prints a recursive listing of a directory's content, meaning that it will list not only the files and directories in the current directory, but also the files and directories in all the subdirectories12. For example, if you have a directory structure like this:
/home/user/dir1file1file2dir2file3file4
You can use the command ls -R /home/user/ to list all the files and directories recursively, and the output will look like this:
/home/user/: dir1 dir2
/home/user/dir1: file1 file2
/home/user/dir2: file3 file4
The -R parameter is also known as the --recursive option, which is the long form of the same parameter12.
You can use either -R or --recursive to achieve the same result.
References:
* Use ls Command Recursively - Linux Handbook
* How to List Files Recursively in Linux command line


NEW QUESTION # 62
Which of the following programs is a graphical editor for vector graphics?

  • A. Samba
  • B. Inkscape
  • C. MySQL
  • D. NGINX
  • E. Python

Answer: B

Explanation:
Explanation
A vector graphics editor is a software program that allows users to create and edit vector graphics, which are images composed of mathematical curves and shapes. Vector graphics are scalable, meaning they can be resized without losing quality or clarity. Python, NGINX, Samba, and MySQL are not vector graphics editors, but rather other types of software. Python is a programming language, NGINX is a web server, Samba is a file and print server, and MySQL is a database management system. Inkscape is a free and open source vector graphics editor that supports the SVG (Scalable Vector Graphics) format, as well as other formats. Inkscape can be used to create logos, icons, diagrams, illustrations, and other graphics. Inkscape is one of the applications covered in the Linux Essentials certification program from the Linux Professional Institute (LPI).
References:
* Linux Essentials - Linux Professional Institute (LPI)
* Draw Freely | Inkscape


NEW QUESTION # 63
Which of the following permissions are set on the/tmp/directory?

  • A. r-xr-X--t
  • B. ------rwX
  • C. rwxrwxrwt
  • D. rwSrw-rw-
  • E. rwxrwS---

Answer: C


NEW QUESTION # 64
Which of the following commands extracts the contents of the compressed archive file1.tar.gz?

  • A. tar --extract file1.tar.gz
  • B. detar file1.tar.gz
  • C. ztar file1.tar.gz
  • D. tar -xzf file1.tar.gz
  • E. tar -czf file1.tar.gz

Answer: D

Explanation:
Explanation
The correct command to extract the contents of the compressed archive file1.tar.gz is tar -xzf file1.tar.gz. This command uses the following options:
* -x means extract files from an archive.
* -z means filter the archive through gzip, which is a compression program that reduces the size of files.
* -f means 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.gz creates a compressed archive file1.tar.gz from the files specified after the command, not extract it.
* ztar file1.tar.gz is not a valid command, as ztar is not a standard program or option for tar.
* tar --extract file1.tar.gz is missing the -z option to handle the gzip compression, and also the -f option to specify the file name.
* detar file1.tar.gz is not a valid command, as detar is not a standard program or option for tar.
References:
* 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.


NEW QUESTION # 65
Which of the following commands adds the directory /new/dir/ to the PATH environment variable?

  • A. export $PATH=/new/dir: $PATH
  • B. PATH=/new/dir: PATH
  • C. export PATH=/new/dir: PATH
  • D. export PATH=/new/dir: $PATH
  • E. $PATH=/new/dir: $PATH

Answer: C

Explanation:
The PATH environment variable is a colon-separated list of directories that the shell searches for commands. To add a new directory to the PATH, you need to append it to the existing value of the variable, using the syntax PATH=new/dir:PATH. However, this only changes the PATH for the current shell session. To make the change permanent, you need to use the export command, which makes the variable available to all child processes of the shell. The export command takes the name of the variable as an argument, without the dollar sign ($). Therefore, the correct command to add /new/dir/ to the PATH and export it is export PATH=/new/dir:PATH. Reference:
Linux Essentials - Linux Professional Institute (LPI)
How to set the path and environment variables in Windows - Computer Hope


NEW QUESTION # 66
Which of the following commands are used to get information on the proper use of ls? (Choose two.)

  • A. man ls
  • B. option ls
  • C. manual ls
  • D. info ls
  • E. usage ls

Answer: A,D


NEW QUESTION # 67
Which of the following commands are used to get information on the proper use of ls? (Choose two correct answers.)

  • A. man ls
  • B. option ls
  • C. manual ls
  • D. info ls
  • E. usage ls

Answer: A,D

Explanation:
Explanation
The commands man ls and info ls are used to get information on the proper use of ls. The man command displays the manual page for a given command, which contains a description, synopsis, options, examples, and other details. The info command displays the info page for a given command, which is similar to the manual page but may have more information and hyperlinks. The option ls, usage ls, and manual ls commands are not valid commands in Linux and will result in an error message. References:
* Linux Essentials Exam Objectives, Version 1.6, Topic 103.1, Weight 2
* Linux Essentials Certification Guide, Chapter 3, Page 51-52
* Ls Command in Linux (List Files and Directories) | Linuxize


NEW QUESTION # 68
Which command adds the new usertuxand creates the user's home directory with default configuration files?

  • A. passwd -a tux
  • B. defaultuser tux
  • C. usercreate tux
  • D. useradd -m tux
  • E. useradd -o default tux

Answer: D

Explanation:
Explanation
The useradd command in Linux is used to create new user accounts on the system1. The -m option tells the command to create the user's home directory as /home/username and copy the files from /etc/skel directory to the user's home directory2. The /etc/skel directory contains the default configuration files for new users3.
Therefore, the command useradd -m tux will add the new user tux and create the user's home directory with default configuration files. The other options are either invalid or do not create the user's home directory.
References:
* Linux Essentials Version 1.6 Objectives, Topic 1.4: Command Line Basics, Subtopic: Basic Shell Commands
* Linux Essentials Version 1.6 Exam Preparation Guide, Section 1.4: Command Line Basics, Page 16
* Linux useradd Command Tutorial for Beginners (15 Examples)


NEW QUESTION # 69
What is a Linux distribution?

  • A. An operating system based on Linux but incompatible to the regular Linux kernel.
  • B. A bundling of the Linux kernel, system utilities and other software.
  • C. The set of rules which governs the distribution of Linux kernel source code.
  • D. A set of changes to Linux which enable Linux to run on another processor architecture.
  • E. The Linux file system as seen from the root account after mounting all file systems.

Answer: B

Explanation:
A Linux distribution is a collection of software that is based on the Linux kernel and can be installed on a computer or a device to create a functional operating system. A Linux distribution typically includes the Linux kernel, a set of system utilities and libraries, a graphical user interface (GUI), a package manager, and various applications and services. A Linux distribution may also include additional software or features that are specific to the distribution's goals, target audience, or philosophy. For example, some Linux distributions are designed for desktop users, while others are optimized for servers, embedded systems, or security. Some Linux distributions are based on other Linux distributions, while others are developed independently. Some Linux distributions are free and open source, while others are proprietary or commercial. Some Linux distributions are popular and widely used, while others are niche or experimental. Some examples of Linux distributions are Ubuntu, Fedora, Debian, Mint, Arch, and Red Hat. Reference:
Linux Essentials Topic 101: System Architecture, section 101.1: Determine and configure hardware settings.
Linux Essentials Topic 102: Linux Installation and Package Management, section 102.1: Design hard disk layout.
Linux Essentials Topic 103: GNU and Unix Commands, section 103.1: Work on the command line.
Linux Essentials Topic 104: The Linux Operating System, section 104.1: Boot the system.
Linux Essentials Topic 105: The Power of the Command Line, section 105.1: Use text streams and filters.
Linux Essentials Topic 106: Security and File Permissions, section 106.3: Modify file and directory permissions.
What is a Linux distribution? - Linux.com
Linux distribution - Wikipedia
Best Linux Distributions For Everyone in 2023 - It's FOSS


NEW QUESTION # 70
Why are web browser cookies considered dangerous?

  • A. Cookies store critical data which is lost when a cookie is deleted.
  • B. Cookies consume significant amounts of storage and can exhaust disk space.
  • C. Cookies support identification and tracking of users.
  • D. Cookies are always public and accessible to anyone on the internet.
  • E. Cookies can contain and execute viruses and malware.

Answer: C


NEW QUESTION # 71
Which of the followingoutputs could stem from the commandlast?

  • A. 1 ls
    2 cat text.txt
    3 logout
  • B. Password for user last changed at Sat Mar 31 16:38:57 EST 2018
  • C. root tty2 Wed May 17 21:11 - 21:11 (00:00)
  • D. EXT4-fs (dm-7): mounted filesystem with ordered data mode. Opts: (null)
  • E. Last login: Fri Mar 23 10:56:39 2018 from server.example.com

Answer: C


NEW QUESTION # 72
What is true about thedmesgcommand? (Choose two correct answers.)

  • A. It immediately outputs all new messages written to the system journal.
  • B. It displays the content of the Linux kernel's ring buffer.
  • C. It might not display older information because it was overwritten by newer information.
  • D. It sends messages to the command lines of all current user sessions.
  • E. It traces the execution of a command and shows each step the program carries out.

Answer: B,C


NEW QUESTION # 73
......

Pass Your LPI Linux Essentials 010-160 Exam on Mar 18, 2026 with 80 Questions: https://certkingdom.practicedump.com/010-160-practice-dumps.html