TestOut Linux Pro | Mid-term Practice Questions

studied byStudied by 58 people
4.0(2)
Get a hint
Hint

Linux can be implemented in many different ways.

Drag the implementation type on the left to the definition on the right that BEST matches.

Running Linux and Windows on the same physical computer.

Infrastructure as a Service (IaaS).

Used by Google on many of the physical products it sells.

Manages intelligent devices, such as automation and control equipment.

Options: Embedded Linux, Linux & Cloud Computing, Linux Virtualization, Linux on mobile devices.

1 / 349

flashcard set

Earn XP

Description and Tags

if ur here because of the prof aygun exam... gl

350 Terms

1

Linux can be implemented in many different ways.

Drag the implementation type on the left to the definition on the right that BEST matches.

Running Linux and Windows on the same physical computer.

Infrastructure as a Service (IaaS).

Used by Google on many of the physical products it sells.

Manages intelligent devices, such as automation and control equipment.

Options: Embedded Linux, Linux & Cloud Computing, Linux Virtualization, Linux on mobile devices.

Running Linux and Windows on the same physical computer: Linux virtualization

Infrastructure as a Service (IaaS): Linux and Cloud Computing

Used by Google on many of the physical products it sells: Linux on mobile devices

Manages intelligent devices, such as automation and control equipment: Embedded Linux

New cards
2

When working with Linux, it is important to understand what distributions are and how they are used.

Which of the following BEST describes a Linux distribution?

An application capable of running on Linux.

A unique bundling of the Linux kernel.

A pre-written code element programmers can use within programs.

The kernel used to build a Linux operating system.

A unique bundling of the Linux kernel.

New cards
3

Your company develops applications to run on Linux systems. You currently have four development teams, each working on a different aspect of the same application. Which of the following server roles would give you the BEST method for testing all team members' code without affecting your part of the project or your operating system and personal files?

Load balancer

Containers

Clustering

Database

Monitoring

Containers

New cards
4

Alex, a webmaster, is implementing an order processing system on the company's website. Which of the following server roles should Alex implement with the order processing application?

Monitoring

Clustering

VPN

Database

Database

New cards
5

Drag the server role on the left to its proper description on the right.

A protocol used to communicate with and monitor network devices and servers.

A protocol used to securely log on to remote systems using encryption.

Resolves (or maps) the fully qualified domain names (FQDNs) to IP addresses.

A program responsible for accepting HTTP (Hypertext Transfer Protocol) requests from clients.

Options: Web server, SSH, SNMP, Name server

A protocol used to communicate with and monitor network devices and servers: SNMP

A protocol used to securely log on to remote systems using encryption: SSH

Resolves (or maps) the fully qualified domain names (FQDNs) to IP addresses: Name server

A program responsible for accepting HTTP (Hypertext Transfer Protocol) requests from clients: Web server

New cards
6

Drag the server role on the left to its proper description on the right.

Capturing a timeline of events that have taken place on the computer in the form of a file.

A type of network that uses encryption to allow IP traffic to travel securely over the TCP/IP network.

Increases response time to back-end servers by distributing the workload across the available servers.

A computer that provides indirect internet access to the computers in your network.

Options: Proxy, Load balancer, Logging, VPN

Capturing a timeline of events that have taken place on the computer in the form of a file: Logging

A type of network that uses encryption to allow IP traffic to travel securely over the TCP/IP network: VPN

Increases response time to back-end servers by distributing the workload across the available servers: Load balancer

A computer that provides indirect internet access to the computers in your network: Proxy

New cards
7

Your company uses both Linux desktops and Windows desktops. Which of the following server roles should you use to provide a central location for users of both operating systems to share files?

Database

File servers

Proxy

Authentication server

File servers

New cards
8

Your company has been expanding the number of servers in the company's data center, and there is an increased need to gather metrics, watch process states, work with logs, watch services states and file system usage. Which of the following sever roles should be installed to provide this functionality?

Database

Containers

Monitoring

Logging

Monitoring

New cards
9

Which of the following is the primary role of a mail transfer agent (MTA)?

Store messages so they can be downloaded or send email to a destination MTA.

Provide redundant online storage for the mail sever.

Control the bandwidth used by mail user agent (MUA).

Transfer mail to a print server queue.

Store messages so they can be downloaded or send email to a destination MTA.

New cards
10

An IT technician has been given a work order to install the Apache web server on a system configured with a YUM repository. Which of the following commands will install the web server?

yum install apache2

rpm -ivh apache2

yum install httpd

dnf install httpd

yum install httpd

New cards
11

You are at a terminal command prompt in a Linux GUI interface that someone else has been using and want to find out which shell type is currently being used by the terminal. What command can you enter to find out the current shell type?

echo $SHELL

echo $PATH

echo $UID

echo $0

echo $0

New cards
12

In which of the following files is the user's preferred shell normally set?

/etc/group

/etc/passwd

/etc/profile

/etc/shadow

/etc/passwd

New cards
13

Which of the following is the standard shell for MOST Linux computers?

Bourne shell

C-shell

Korn

Bourne again shell (bash)

tcsh

Bourne again shell (bash)

New cards
14

What would you enter at a command prompt to start a new Bourne again shell (Bash) session?

bash

New cards
15

You are managing a Linux server with a console (without a GUI installed). Which of the following key combinations would you press to switch to the fourth shell session?

Ctrl+F4

Ctrl+Shift+4

Ctrl+Alt+F4

Ctrl+4

Ctrl+Alt+F4

New cards
16

A Linux user has an executable file named ni that can save a snapshot of network information with the date and time in a log file. The executable ni file is in the /root directory, and /root is the current working directory. Which of the following commands would run the executable file? (Select two.)

/root/ni

./ni

ni

exec ni

source ni

/root/ni, ./ni

New cards
17
New cards
18
New cards
19
New cards
20
New cards
21

You have just entered the apropos grep command at the command prompt. What can you expect to be displayed?

A one-line man page description for the grep command.

The appropriate use of the grep command in your Linux system.

The syntax available for the grep command.

The apropos information in the grep command man pages.

A one-line man page description for the grep command.

New cards
22

Which of the following man page sections shows a list of options available for a Linux command and explains what the options do?

SYNOPSIS

DESCRIPTION

TITLE

NAME

DESCRIPTION

New cards
23

You have forgotten what information is provided by the whoami command, and simply want a short description of the command. Which of the following help commands could you enter to view that short description?

help -d whoami

help -s whoami

help whoami

help -m whoami

help -d whoami

New cards
24

If you are viewing the contents of a man page, which key can you press to get back to the beginning of the page?

home

New cards
25

Which of the following commands would you enter to view info node information about the sysctrl command?

info "systctrl"

info -w sysctrl

info sysctrl

info -k sysctrl

info sysctrl

New cards
26

Which of the following are characteristics make info nodes different from man pages? (Select two.)

They are more verbose and emphasize how to use commands and utilities.

They contain a SYNOPSIS section for reviewing the syntax of a command.

You can use the End key to go to the end of a page.

They contain hypertext links to navigate between nodes.

You can use the PgUp and PgDn keys to move one page at a time.

They are more verbose and emphasize how to use commands and utilities, They contain hypertext links to navigate between nodes.

New cards
27

You want to search all the man pages for information available for the Bluetooth protocol. Which of the following commands would you enter to display this information?

man bluetooth

man -f bluetooth

man -k bluetooth

man -w bluetooth

man -k bluetooth

New cards
28

You are working on a Linux system and need more information about the uname command. What would you enter at the command prompt to learn about the uname command syntax and options?

man uname

New cards
29

You want to view the Linux help information for the mkdir command. While viewing the information, you want to be able to scroll through the onscreen help. What is the command you would use to display and be able to scroll through the mkdir help information?

mkdir --help | more

mkdir --help | more

New cards
30

Which of the following commands searches man pages for a specific keyword? (Select three.)

apropos

whatis

export

man -k

help

find

slocate

apropos, whatis, man -k

New cards
31

Which of the following nano editor keyboard shortcuts displays help text, including a list of all keyboard shortcuts?

M-Space (Alt+Space or Esc+Space)

M-A (Alt+A or Esc+A)

^O (Ctrl+O)

^G (Ctrl+G)

^G (Ctrl+G)

New cards
32

Which of the following nano text editor features makes it easier for beginners to learn than the vi text editor?

Keyboard shortcuts are displayed at the bottom of the editor.

The software falls under the GNU General Public License.

There are multiple operational modes.

It is included in most Linux distributions.

Keyboard shortcuts are displayed at the bottom of the editor.

New cards
33

Match the nano shortcut on the left to the correct shortcut definition on the right.

Cuts the current line (or selected text) and stores it in the cutbuffer.

Closes the current buffer or exits from nano.

Uncuts (pastes) the text from the cutbuffer into the current line.

Moves forward one word in the current line.

Displays the help text, which includes a list of all keyboard shortcuts.

Options: ^K (Ctrl+K), ^X (Ctrl+X), ^U (Ctrl+U), ^Space (Ctrl+Space), ^G (Ctrl+G)

Cuts the current line (or selected text) and stores it in the cutbuffer: ^K (Ctrl+K)

Closes the current buffer or exits from nano: ^X (Ctrl + X)

Uncuts (pastes) the text from the cutbuffer into the current line: ^U (Ctrl+U)


Moves forward one word in the current line: ^Space (Ctrl+Space)


Displays the help text, which includes a list of all keyboard shortcuts: ^G (Ctrl+G)

New cards
34

Match the vi command on the left with the correct description of the cursor movement the on the right.

Move the cursor up a line.

Move the cursor one space to the left.

Move the cursor one space to the right.

Move the cursor down a line.


Options: k, l, j, h

Move the cursor up a line: k

Move the cursor one space to the left: h

Move the cursor one space to the right: l

Move the cursor down a line: j

New cards
35

As an IT administrator, you are tasked with configuring an Apache web server by modifying the /etc/apache2/apache2.conf file. You open the file in vi. As you're looking at the file, you knock your spill-proof drink container onto the keyboard. It rolls over several keys as you try to pick it up. Now there are extra characters everywhere in the text buffer. Which of the following commands can you use to exit vi without saving any changes that were made to the text buffer?

:wq

:q

:q!

:x

:q!

New cards
36

What command would you enter while in vi Command Mode to find the word Sam?

/Sam

New cards
37

A friend sends you a shell script file that is 117 lines long. He says that he wants you to check the code on lines 82 through 87.

What command would you enter while in vi command mode to go directly to line 82?

#82

New cards
38

Match the vi mode on the left to the correct definition on the right.

The initial mode used when vi is started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes.

The vi mode that works with the file system. Use it to save files after editing them.

The vi mode used to write and edit text in the file.


Options: Command line mode, Edit mode, Command mode

The initial mode used when vi is started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes: Command mode

The vi mode that works with the file system. Use it to save files after editing them: Command line mode

The vi mode used to write and edit text in the file: Edit mode

New cards
39

While in vi Command Mode, you copy a whole line of text to the general buffer. You then navigate to a different location in the file. Which of the following commands will let you paste the copied text?

u

dw

cc

p

p

New cards
40

Which of the following vi key combinations should you press while in Insert Mode to save the file you are working on and exit the editor?

<Esc>:wq

<Esc>s

<Esc>:q

<Esc>S

<Esc>:wq

New cards
41

What command displays a list of the currently defined aliases on the system?

alias

New cards
42

You want to make an alias persistent across all reboots of your Linux server. In which of the following files do you need to place the alias command to make the alias persistent?

/home/user/.bashrc

/etc/securetty

/etc/profile

/etc/resolv.conf

/home/user/.bash_profile

/home/user/.bashrc, /etc/profile

New cards
43

Which of the following Linux features lets you store a shortcut in memory or as part of the shell configuration file that runs a specific command?

Background service

Kernel

Shell

Alias

Alias

New cards
44

You want to create a grepcolor alias that provides a lime green (36) background color to the search terms when using the grep command. You want this command to be persistent when rebooting your Linux server.

What command would you enter into the shell configuration file to create this persistent alias?

alias grepcolor="grep --color=36"

alias grepcolor="grep --color=36"

New cards
45

What commonly predefined alias is configured to run the ls -l command?

ll

New cards
46

Mary Brown is a Linux user with the username mbrown. Mary has a directory named logs in her home directory that is regularly updated with new log files when certain system events occur. She runs the following commands several times a week to check this directory:

  • cd /home/mbrown/logs

  • ls -al

She wants a persistent alias named logcheck to run these two commands. What command would Mary enter into the shell configuration file to create this persistent alias?

alias logcheck="cd /home/mbrown/logs;ls -al"

alias logcheck="cd /home/mbrown/logs;ls -al"

New cards
47

Which of the following actions defines a persistent alias?

answer

Adding the command defining the alias to the $ALIAS environment variable.

Adding the command defining the alias to the /etc/default/alias.conf file.

Adding the command defining the alias to the appropriate shell configuration file.

Using the alias command at the shell prompt with the -P option.

Adding the command defining the alias to the appropriate shell configuration file.

New cards
48

Which of the following commands creates a shortcut that can be used to run the tail -f /var/log/messages command?

env alias="tail -f /var/log/messages"

export sysmesg="tail -f /var/log/messages"

export alias="tail -f /var/log/messages"

alias sysmesg="tail -f /var/log/messages"

alias sysmesg="tail -f /var/log/messages"

New cards
49

You have created a listgroups alias that you now want to remove.

Which of the following commands will remove the alias?

unalias listgroups

unalias "listgroups"

unalias -a listgroups

unalias -a "listgroups"

unalias listgroups

New cards
50

When creating a custom alias, how many commands can you add to the alias?

1 or more

3 or more

2 or more

1

1 or more

New cards
51

Anna, a system administrator, wants to set an environment variable that can be used each time she logs in. Currently, Anna has to set the variable each time a terminal is opened.

Which of the following files would Anna need to modify to make the variable a global environment variable? (Select two.)

~./bash_logout

~/.bashrc

~./bash_history

~./bash_profile

/etc/profile

~./bash_profile, /etc/profile

New cards
52

You want to view the number of commands your bash shell is set to save by examining the current HISTSIZE environment variable. You don't want to have to scroll through all the environment variables. Which of the following commands is the BEST way to determine the current value of the HISTSIZE variable?

cat $HISTSIZE

cat /etc/profile | grep "HISTSIZE"

echo $HISTSIZE

HISTSIZE=

echo $HISTSIZE

New cards
53

Which of the following commands displays the value of the LANG environmental variable currently set for the language the operating system uses?

echo %LANG

echo $LANG

echo %LANG%

echo LANG

echo $LANG

New cards
54

You need to set the COMP variable to the value 1745.

Which of the following commands sets the variable, so it is inherited by subsequent child shells?

COMP=1745

set COMP to 1745

export COMP=1745

set COMP=1745

export COMP=1745

New cards
55

You recently used the HOST=FS4 command. Which of the following commands should you use to change the HOST variable to an environment variable that will be inherited by subsequent child shells and processes?

env HOST

export HOST

set HOST

unset HOST

export HOST

New cards
56

Tim, a technician, creates a local variable named val and sets it to 5000 at the bash prompt. Tim wants to use the variable in a script. But when the script is executed, the value of val is not set to 5000. Which of the following commands would allow Tim to set val as an environment variable that would be available to the script?

echo $val=5000

export val=5000

declare val

exec val

export val=5000

New cards
57

Which of the following commands configures the shell to retain 300 recently used commands in the ~/.bash_history file for multiple shell sessions?

HISTFILESIZE=300

HISTFILE=300

HISTSIZE=300

BASH=300

HISTFILESIZE=300

New cards
58

You want the directory /sbin/special to be include in the PATH environment variable. You also want to keep all the current directory entries currently in the PATH variable. Which of the following commands would you use?

PATH=$PATH:$/sbin/special

PATH=PATH&/sbin/special

PATH=/sbin/special

PATH=$PATH:/sbin/special

PATH=$PATH:/sbin/special

New cards
59

Which of the following statements BEST describes the PATH environment variable?

It specifies the filename where past commands are stored.

It contains the directory prefixes used to search for programs and files.

It contains the path of the current working directory.

It specifies the characters the shell uses to indicate normal user ($), root user (#), and similar items.

It contains the directory prefixes used to search for programs and files.

New cards
60

Which command displays all the environment variables defined in the shell?

printenv

New cards
61

A user starts a bash session and the script in /etc/profile. If all of the following files exist, which will be run next?

~/.bash_profile

~/.bash_logout

~/.bash_login

~/.profile

~/.bash_profile

New cards
62

All users at your site are using the bash shell. You want to set a variable that will apply to every user and always have the same value. Which of the following shell configuration files should you place this variable in?

.bash_login

.bashrc

/etc/profile

.bash_profile

/etc/profile

New cards
63

From the drop-down list below, select the file that is called by the non-login shell configuration file.

~/.bashrc

~/.bashrc

New cards
64

Which of the following are examples of a user running a login shell? (Select two.)

When the Linux system does not have a GUI and the user logs in using the text-based interface.

When a user opens a new shell from a shell prompt.

When a user opens a shell session (terminal application) from within the GUI.

When a user runs the sudo -i <user ID> command and enters the correct password.

When a user runs the sudo <user ID> command without the -i option.

When the Linux system does not have a GUI and the user logs in using the text-based interface, When a user runs the sudo -i <user ID> command and enters the correct password.

New cards
65

What type of shell runs after the user successfully logs in using an ID and password? (Type the answer in the blank field.)

New cards
66

Select the file type from the drop-down list below that is also called by non-login shell configuration files.

*.sh files in /etc/profile.d

*.sh files in /etc/profile.d

New cards
67

Which of the following are examples of a user running a non-login shell? (Select two.)

When the Linux system does not have a GUI and the user logs in using the text-based interface.

When a user logs in from a remote system using the SSH protocol.

When a user runs the sudo <user ID> command without the -i option.

When a user opens a shell session (terminal application) from within the GUI.

When a user runs the sudo -i <user ID> command and enters the correct password.

When a user runs the sudo <user ID> command without the -i option, When a user opens a shell session (terminal application) from within the GUI.

New cards
68

What type of shell runs when a user opens a shell after first authenticating with a user ID and password? (Type the answer in the blank field.)

non-login

non-login

New cards
69

Which of the following files could you use to create aliases that are applied when a specific user starts a bash session? (Select two.)

~/.bashrc

/etc/profile

~/.bash_logout

~/.profile

/etc/bashrc

~/.bashrc, ~/.profile

New cards
70

Each time you present credentials to log in, you want a particular entry to be written to a log file. This action will only apply to yourself. You are using the bash shell. Which of the following configuration files is the BEST to modify to enable this action?

.bashrc

.sh

/etc/profile

.profile

.profile

New cards
71

Which of the following commands sorts the combined contents of the wordlist1 and wordlist2 files and sends the results to both the screen and a file named sortedwordlist?

cat /usr/wordlist1 /usr/wordlist2 | sort sortedwordlist

cat /usr/wordlist1 /usr/wordlist2 | tee sortedwordlist

cat /usr/wordlist1 >> /usr/wordlist2 | sort sortedwordlist

cat /usr/wordlist1 /usr/wordlist2 | sort | tee sortedwordlist

cat /usr/wordlist1 /usr/wordlist2 | sort | tee sortedwordlist

New cards
72

Which of the following commands gives the same results as cat < turbo?

cat turbo

cat 2> turbo

cat &> turbo

cat 1> turbo

cat turbo

New cards
73

As a Linux script developer you are trying to debug a shell script that has the command ls -s in it. You suspect that an error is occurring, and want to send the results of the operation and any errors to a file named ~/Friday in order to examine it later. Which of the following commands should you use?

ls -s < ~/Friday

ls -s > ~/Friday

ls -s >> ~/Friday

ls -s &> ~/Friday

ls -s &> ~/Friday

New cards
74

A bash script developer is trying to debug a shell script named myscript. Which of the following commands would record the output of the script in a testfile.txt text file?

myscript | testfile.txt

echo myscript >> testfile.txt

myscript >> testfile.txt

myscript | echo | testfile.txt

myscript >> testfile.txt

New cards
75

Which command reads from standard input (stdin) and writes to both standard output (stdout) and a file?

tee

New cards
76

Which of the following describes the effects of the ls -l /usr/bin >> /tmp/list.txt command?

The contents of the /usr/bin directory are written to a file named /tmp/list.txt. Previous file contents are kept, and the new information is added at the end of the file.

The contents of the /usr/bin directory are written to a file named /tmp/list.txt. Previous file contents are kept, and the new information is added at the beginning of the file.

The contents of the /usr/bin directory are written to a file named /tmp/list.txt. Previous file contents are overwritten.

The contents of the /usr/bin directory are written to both the screen and to a file named /tmp/list.txt. Previous file contents are overwritten.

The contents of the /usr/bin directory are written to a file named /tmp/list.txt. Previous file contents are kept, and the new information is added at the end of the file.

New cards
77

Which of the following commands stores the output of the ls -a command in a shell variable named allfiles?

allfiles=$(ls -a)

allfiles=$((ls -a))

allfiles="exec ls -a"

allfiles=${ls -a}

allfiles="ls -a"

allfiles=$(ls -a)

New cards
78

A shell script developer knows that the date +%A command gives the current local weekday name (Sunday, Monday, Tuesday, ...). Which of the following commands will copy the authentication log file, /var/log/auth.log, to a new file with a filename that includes the current local weekday name?

cp /var/log/auth.log ~/auth${date +%A}.log

tee /var/log/auth.log > date +%A -log

cp /var/log/auth.log ~/auth$(date +%A).log

xargs /var/log/auth.log ~/auth$(date +%A).log

cp /var/log/auth.log ~/auth$(date +%A).log

New cards
79

Which of the following commands utilize command substitution? (Select two.)

echo -e 'sort -r names.txt'

myvar=$(sort -r names.txt)

myvar="echo 'sort -r names.txt'"

myvar=`sort -r names.txt`

echo -e "$(sort -r names.txt)"

myvar=$(sort -r names.txt), myvar=`sort -r names.txt`

New cards
80

Which command overcomes the 128 KB shell command size restriction by breaking up long lists of arguments?

xargs

New cards
81

Which of the following commands will (by itself) copy the entire /temp directory with all of its files, sub-directories, and files in the sub-directories to the /home/gshant directory? (Select two.)

cp /temp /home/gshant

cp -r /temp /home/gshant

cp -R /temp /home/gshant

cp -q /temp /home/gshant

cp -s /temp /home/gshant

cp -r /temp /home/gshant, cp -R /temp /home/gshant

New cards
82

Which of the following commands displays an expanded listing that includes the owner and size of all the files in the /etc directory?

ld -ae /etc

ls -ae /etc

ls -al /etc

dir -al /etc

ls -al /etc

New cards
83

You need to view the contents of the /home/jerrys directory. What would you enter at the command prompt to show all the contents, including hidden files and directories?

ls -a /home/jerrys

ls -a /home/jerrys

New cards
84

The ls command displays the contents of a directory and includes several options. From the list on the left, drag an option to its correct description on the right.

Displays directories but not files.

Displays extended information including the owner, modified date, size and permissions.

Reverses the sort order of the list.

Displays all directory contents, including hidden content.

Displays the contents of a directory and all of its subdirectories.

Options: -R, -r, -a, -l, -d

Displays directories but not files: -d

Displays extended information including the owner, modified date, size and permissions: -l

Reverses the sort order of the list: -r

Displays all directory contents, including hidden content: -a

Displays the contents of a directory and all of its subdirectories: -R

New cards
85

As a Linux administrator, you need to create the directory /var/oracle/database/9i. Only the directory /var currently exists. The current working directory is the root of the filesystem. Which of the following commands will create the directory path?

md -path /var/oracle/database/9i

mkdir /var/oracle/database/9i

mkdir -p /var/oracle/database/9i

mkd /var/oracle/database/9i

mkdir -p /var/oracle/database/9i

New cards
86

You want to rename the quarterlyreports.txt file in the /sales/reports directory to qreports.txt. You are currently in the root directory at the command prompt. What command can you enter to rename the file?

mv /sales/reports/quarterlyreports.txt /sales/reports/qreports.txt

mv /sales/reports/quarterlyreports.txt /sales/reports/qreports.txt

New cards
87

You want to move a directory (and its files) to a destination directory that stores some of the same files using the mv command. You want to include the mv command in a script without monitoring the copy process. In addition, you do not want to overwrite the files in the destination directory. Which of the following mv command options would you use to prevent overwriting files?

-f

-i

-n

-R

-n

New cards
88

The /home/gshant/smp directory is empty and needs to be removed. The current working directory is /home/gshant.

What would you enter at the command prompt to remove the smp directory?

rmdir smp

New cards
89

Within the /var directory is a subdirectory named backup. You need to delete the directory backup and any files that it contains. You change the directory focus to /var. Which of the following commands will delete the directory named backup and any file it contains?

rm -r backup

rm backup

rm backup/*

rm -r backup/*

rm -r backup

New cards
90

The /home/gshant/smp directory contains several files. The directory and files need to be removed. The current working directory is /home/gshant. What would you enter at the command prompt to remove the SMP directory and all the files it contains?

rm -r smp

New cards
91

Which of the following commands can you use to combine the content of three files into a single text stream?

pr

cat

nl

cut

cat

New cards
92

A Linux administrator is logged in as root and needs to copy a file named letter.doc from the USB flash drive mounted under /media/usb. Which of the following commands will copy the file from the USB flash drive to the root user's home directory?

cp /media/usb/letter.doc /root

cp /dev/usb/letter.doc /root

cp /media/usb/letter.doc home:

cp /mnt/usb:letter.doc /root

cp /media/usb/letter.doc /root

New cards
93

What would you enter at the command prompt to display a file's type?

file

file

New cards
94

A user, ljenkins, contacts the help desk about an error received while removing a file from their home directory. The user received the following error when trying to use the rm command to remove the file:

[ljenkins@fileserver]$ rm report.txt
rm: remove write-protected regular empty file 'myfile2.txt'? y
rm: cannot remove 'myfile2.txt': Operation not permitted

While troubleshooting the issue, you list files in the directory to see if you can discover the issue:

[ljenkins@fileserver]$ ls -al
total 4
drwxr-xr-x. 2 ljenkins ljenkins 24 Feb 25 12:04 .
drwx 15 ljenkins ljenkins 4096 Feb 25 11:04 ..
-rw-rw-r--. 1 ljenkins ljenkins 346 Feb 25 11:32 report.txt

When prompted to remove the write-protected file, ljenkins entered yes and received an "Operation not permitted" error message. As the help desk technician, you attempt to remove the file with root privileges and receive the same error message. You decide to view the file attributes and receive the following output:

[helpdesk@fileserver]$ lsattr

----I----------- ./report.txt

Which of the following commands would resolve the problem and allow the file to be deleted?

sudo rm -vR report.txt

sudo rm --force report.txt

sudo chattr -i report.txt && rm report.txt

sudo lsattr report.txt | rm report.txt

sudo chattr -i report.txt && rm report.txt

New cards
95

Which of the following commands displays the attributes of the /boot/grub/grub.conf file?

lsattr /boot/grub/grub.conf

ls -l /boot/grub/grub.conf

cat /boot/grub/grub.conf

vi /boot/grub/grub.conf

lsattr /boot/grub/grub.conf

New cards
96

You attempt to view the contents of a directory, but the output of the ls -l command scrolls beyond the limit of one console window.

Which of the following commands would allow you to see the full listing of the directory?

ls -l | less

ls -l >> less

ls -paged

ls -p

ls -l | less

New cards
97

Which of the following commands moves a file from one location to another?

cp -d

move

copy -r

mv

mv

New cards
98

Which of the following commands will change the /home/pmallory/reports filename to reports.bak?

cp -n /home/pmallory/reports /home/pmallory/reports.bak

mv /home/pmallory/reports /home/pmallory/reports.bak

rm /home/pmallory/reports /home/pmallory/reports.bak

touch -n /home/pmallory/reports /home/pmallory/reports.bak

mv /home/pmallory/reports /home/pmallory/reports.bak

New cards
99

An employee has mistakenly copied a secure, private file from a network directory to their local hard drive. You want to completely overwrite the file data on the hard drive, as well as delete the file inode (file metadata). Which of the following commands would you use to perform this task?

rm -i

shred -u

shred -v

rm -dir

shred -u

New cards
100

Which of the following commands changes the /home/gshants/smile file's modification and last accessed times to the current time?

answer

Correct Answer:

touch /home/gshants/smile

ls /home/gshants/smile

cat /home/gshants/smile

rm /home/gshants/smile

touch /home/gshants/smile

New cards

Explore top notes

note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 29 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 31 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 239 people
Updated ... ago
5.0 Stars(2)
note Note
studied byStudied by 46 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 29 people
Updated ... ago
4.5 Stars(2)
note Note
studied byStudied by 7 people
Updated ... ago
5.0 Stars(1)
note Note
studied byStudied by 76 people
Updated ... ago
5.0 Stars(1)

Explore top flashcards

flashcards Flashcard22 terms
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard57 terms
studied byStudied by 22 people
Updated ... ago
4.0 Stars(1)
flashcards Flashcard36 terms
studied byStudied by 1 person
Updated ... ago
5.0 Stars(1)
flashcards Flashcard27 terms
studied byStudied by 5 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard63 terms
studied byStudied by 74 people
Updated ... ago
5.0 Stars(7)
flashcards Flashcard83 terms
studied byStudied by 37 people
Updated ... ago
5.0 Stars(1)
flashcards Flashcard43 terms
studied byStudied by 10 people
Updated ... ago
4.0 Stars(1)
flashcards Flashcard46 terms
studied byStudied by 44 people
Updated ... ago
5.0 Stars(2)