Limited-Time Summer Sale 25% Discount Offer - Apply Coupon Code: Save25
Certs Blitz
See all results for ""
Home Exams
CRISC ISACA CISSP ISC2 200-301 Cisco SY0-701 CompTIA AZ-104 Microsoft AI-900 Microsoft AIGP IAPP 1Z0-1067-26 Oracle View All Exams →
Sign in Create account
010-160 EXAM PREPARATION

Prepare Smarter for the 010-160 Exam

Build your exam confidence with flexible preparation resources designed around the latest 010-160 exam objectives. Practice at your own pace using PDF questions, online exam simulations, or desktop practice software.

Download Exam View Entire Exam
Page: 1 / 1
Question #1 (Topic: Demo Questions)

Which of the following examples shows the general structure of a for loop in a shell script?

A.

for *.txt as file = > echo $file

B.

for *.txt ( echo $i )

C.

for file in *.txt do
echo $i done

D.

for ls *.txt exec {} \;

E.

foreach @{file} { echo $i

}

Correct Answer: C
Explanation:

The general structure of a for loop in a shell script is as follows 1 2 :

for variable in list do commands done

The variable is the name of a loop counter or iterator that takes on the values of the items in the list. The list can be a sequence of words, numbers, filenames, or the output of a command. The commands are the body of the loop that are executed for each va l ue of the variable. The do and done keywords mark the beginning and the end of the loop body.

The option C. for file in *.txt do echo $i done follows this structure, with the variable b e ing file, the list being *.txt (which matches all the files with the .txt extension in the cu r rent directory), and the command being echo $i (which prints the value of the variable i, which is presumably set somewhere else in the script).

The other options are incorrect because:

    A. for *.txt as file = > echo $file uses an invalid syntax for a for loop. The as ke y word is not part of the shell script syntax, and the = > symbol is not a valid operator. The correct way to write this loop would be:

for file in *.txt do echo $file done

    B. for *.txt ( echo $i ) uses an invalid syntax for a for loop. The parentheses are not part of the shell script syntax, and the loop body is missing the do and done keywords. The correct way to write this loop would be:

for i in *.txt do echo $i done

    D. for ls *.txt exec {} ; uses an invalid syntax for a for loop. The ls command is not a valid variable name, and the exec {} ; is not a valid command. This looks like a mix of a for loop and a find command. The correct way to write this loop would be:

for file in *.txt do exec $file done

    E. foreach @{file} { echo $i } uses an invalid syntax for a for loop. The foreach keyword is not part of the shell script syntax, and the @{file} and { echo $i } are not valid expressions. This looks like a mix of a for loop and a Perl syntax. The correct way to write this loop would be:

for file in * do echo $file done

[References:, Looping Statements | Shell Script - GeeksforGeeks, How do I write a ‘for’ loop in Bash? - Stack Overflow, ]
Question #2 (Topic: Demo Questions)

Which statements about the directory /etc/skel are correct? (Choose two.)

A.

The personal user settings of root are stored in this directory.

B.

The files from the directory are copied to the home directory of the new user when starting the system.

C.

The files from the directory are copied to the home directory of a new user when the account is created.

D.

The directory contains a default set of configuration files used by the useradd command.

E.

The directory contains the global settings for the Linux system.

Correct Answer: C, D
Explanation:

The /etc/skel directory is a skeleton directory that contains the default files and direct o ries that are automatically copied to the home directory of a new user when the account is created by the useradd command 1 2 .  The purpose of this directory is to provide a co n sistent and uniform environment for all new users and to save the system administr a tor’s time and effort in configuring the user settings 1 2 .  The /etc/skel directory can be customized by adding or removing files and directories as needed, depending on the desired default settings for the new users 1 2 .

The other options are incorrect because:

    A. The personal user settings of root are stored in this directory.  This is not true, as the personal user settings of root are stored in the /root directory, which is the home directory of the root user 3 .  The /etc/skel directory does not affect the root user’s se t tings, but only the settings of the new users created by the useradd command 1 2 .

    B. The files from the directory are copied to the home directory of the new user when starting the system.  This is not true, as the files from the directory are copied to the home directory of the new user when the account is created, not when starting the system 1 2 .  The copying process only happens once, when the useradd command is ex e cuted, and not every time the system is started 1 2 .

    E. The directory contains the global settings for the Linux system.  This is not true, as the directory contains the default settings for the new users, not the global settings for the Linux system 1 2 .  The global settings for the Linux system are usually stored in ot h er directories under /etc, such as /etc/default, /etc/sysconfig, /etc/init.d, etc 4 .

[References:, Understanding the /etc/skel directory in Linux – The Geek Diary, /etc/skel directory in Linux - techPiezo, Linux File System Hierarchy - /root directory - LinuxConfig.org, Linux configuration: Understanding *.d directories in /etc | Enable Sysadmin, , , , , ]
Question #3 (Topic: Demo Questions)

Which of the following commands adds the directory /new/dir/ to the 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 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 o n ly 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 pr o cesses 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 .  References :

    Linux Essentials - Linux Professional Institute (LPI)

    How to set the path and environment variables in Windows - Computer Hope

Question #4 (Topic: Demo Questions)

Which of the following DNS record types hold an IP address? (Choose two.)

A.

NS

B.

AAAA

C.

MX

D.

A

E.

CNAME

Correct Answer: A, D
Explanation:

 The DNS record types that hold an IP address are the A and AAAA records. These re c ords are used to map a domain name to an IP address of the host, which is necessary for establishing a connection between a client and a server. The A record holds a 32-bit IPv4 address, while the AAAA record holds a 128-bit IPv6 address. For example, the A record for www.example.com could be:

www.example.com. IN A 192.0.2.1

This means that the domain name www.example.com resolves to the IPv4 address 192.0.2.1. Similarly, the AAAA record for www.example.com could be:

www.example.com. IN AAAA 2001:db8::1

This means that the domain name www.example.com resolves to the IPv6 address 2001:db8::1.

The other options are incorrect because:

    NS records are used to specify the authoritative name servers for a domain. They do not hold an IP address, but a domain name of the name server. For example, the NS record for example.com could be:

example.com. IN NS ns1.example.com.

This means that the name server ns1.example.com is authoritative for the domain e x ample.com.

    MX records are used to specify the mail exchange servers for a domain. They do not hold an IP address, but a domain name of the mail server and a preference value. For example, the MX record for example.com could be:

example.com. IN MX 10 mail.example.com.

This means that the mail server mail.example.com has a preference value of 10 for r e ceiving email for the domain example.com.

    CNAME records are used to create an alias for a domain name. They do not hold an IP address, but another domain name that the alias points to. For example, the CNAME record for www.example.com could be:

www.example.com. IN CNAME example.com.

This means that the domain name www.example.com is an alias for the domain name example.com.

[References:, DNS Record Types: Defined and Explained - Site24x7, List of DNS record types - Wikipedia, , , , ]
Question #5 (Topic: Demo Questions)

Most commands on Linux can display information on their usage. How can this information typically be displayed?

A.

By running the command with the option /? or /??.

B.

By running the command with the option ?! or ?=!.

C.

By running the command with the option /doc or /documentation.

D.

By running the command with the option -h or --help.

E.

By running the command with the option -m or --manpage.

Correct Answer: D
Explanation:

Most commands on Linux can display information on their usage by running the co m mand with the option -h or --help. This option shows a brief summary of the command syntax, options, arguments, and examples. For example, running  ls -h  or  ls --help  will display the usage information for the ls command, which lists files and directories. The -h or --help option is a standard convention for most Linux commands, and it is useful for learning how to use a command or checking its available options. However, some commands may not support this option, or may use a different option to display usage information. In that case, you can use the man command to access the manual page for the command, which provides more detailed information on the command usage, d e scription, options, arguments, examples, and references. For example, running  man ls  will display the manual page for the ls command. The man command is one of the applications covered in the Linux Essentials certification program from the Linux Profe s sional Institute (LPI).  References :

    Linux Essentials - Linux Professional Institute (LPI)

    Linux Commands Cheat Sheet: Beginner to Advanced - GeeksforGeeks


Download Exam
Page: 1 / 1
Next Page