CIS 112 Test 1

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

cp /media/usb/letter.doc /root

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?

#82

A friend sent you a shell script file that is 117 lines long. He says that he wants you to examine code on lines 82 through 87. What command would you enter while in vi Command Mode to go directly to line 82?

yum install httpd

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

ls -l | less

A user attempts 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 the users to see the full listing of the directory?

.profile

A user has requested that each time she presents credentials to log in, a particular entry be written to a log file. This action will only apply to her, and she is using the bash shell. Which of the following configuration files is the BEST to modify to enable this action?

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

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.txtrm: remove write-protected regular empty file 'myfile2.txt'? yrm: cannot remove 'myfile2.txt': Operation not permitted While troubleshooting the issue, you list files in directory to see if you can discover the issue: [ljenkins@fileserver]$ ls -altotal 4drwxr-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 privilages and recive 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?

/proc

According to the Filesystem Hierarchy Standard (FHS), which of the following directories contains information about the system state and processes?

~/.bash_profile

After a user starts a bash session and the script in /etc/profile is applied, if all of the following files exist, which will be run next?

:

After opening a file in vi, you want to switch from Command Mode to Command Line Mode. What key invokes Command Line Mode?

Database

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?

/etc/profile

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?

ls -s &> ~/Friday

Ann, a Linux script developer, is trying to debug a shell script that has the command ls -s in it. She suspects that an error is occurring, and she wants 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 she use?

/etc/profile ~./bash_profile

Anna, a system administrator, wants to set a global variable that can be used each time she logs in. Currently, she has to set the variable each time a terminal is opened. Which of the following files would need to be modified to make a global variable persistent? (Choose TWO.)

:q!

As an 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?

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

Fred, a Linux administrator, needs 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?

Home

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

myscript >> testfile.txt

Joe, 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 text file?

The number of inodes has been exhausted.

Leroy tries to copy some files to an ext3 volume and received the following error: "No space left on device." Leroy executes the df command and determines that there is sufficient space to copy the files. He also verifies that he has permission to copy the files. Which of the following BEST describes Leroy's problem?

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

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 you enter into her shell configuration file to create this persistent alias?

The symbolic links still exist in Ted's home directory, but they are useless because the link has been broken.

Ted, a Linux user, creates symbolic links in his home directory to a set of files in their /data directory using the ln -s command. Later, a system administrator deletes the files in the /data directory. What happens to the symbolic links that Ted created?

rm -r smp

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?

rmdir smp

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?

The mydata file is a symbolic link to the shantsgems file

The ls command in the current working directory gives the following listing: lrwxrwxrwx 1 root root 4 2010-11-05 mydata -> shantsgems-rwxr-xr-x 1 root root 382 2010-10-05 shantsgems Which of the following is true of the files in this listing?

Authentication server

Tim, a system administrator, wants to simplify the provisioning and disabling of user accounts. Which of the following server roles should Tim install and configure?

export val=5000

Tim, a technician, created a local variable named val and set 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 a global variable that would be available to the script?

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

Tom, 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 that with a filename that includes the current local weekday name?

env

Two users should have identical settings, yet one is having problems with the display on his screen, and you suspect there is a difference in their environment variables. Which of the following commands displays all of the environment variables?

/dev

Under the Filesystem Hierarchy Standard (FHS), what is the full path to the directory that contains the device files for a Linux system?

NTP

Users are complaining that the clocks for their operating systems do not match the current time for the location in which they live. Which of the following server roles is BEST for correcting this issue?

DHCP

Users are complaining that they are unable to connect to any servers or the internet. Based on the symptoms they describe, you suspect that the users are not being assigned the correct IP addresses. Which of the following server roles would be the BEST role to work with to correct this issue?

Press the Esc key Type :wq

Using the vi editor in Insert Mode, you made a few changes to the /boot/grub/grub.conf file. You now need to switch to command mode, save the changes, and quit. Which of the following keystrokes and commands should you use? (Select TWO.) (Each answer is a required part of the solution.)

yy

What command would you enter while in vi command mode to copy an entire line of text to the general buffer?

/Sam

What command would you enter while in vi command mode to find the term Sam?

ll

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

/var

What is the full path to the directory that contains data files that change constantly, including email, print jobs, and proxy cache files?

/usr/share/man

What is the full path to the directory that holds the man files on the system?

file

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

alias

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

printenv

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

| (Weird straight line character)

Which command operator pipes the output of one command as the input of another command?

xargs

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

tee

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

LEAVE BLANK

Which environment variable affects the number of past commands stored in memory in the current shell session?

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

Which of the following actions can be used to define a persistent alias?

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

Which of the following command copies the entire /temp directory with all of its files, sub-directories, and files in the sub-directories to the /home/gshant directory. (Select TWO. Each answer represents an independent solution.)

cat

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

HISTFILESIZE=300

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

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

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

ls -al /etc

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

find / -name '*blue*' -o -name '*gold*'

Which of the following commands finds all of the files on the system that have either blue or gold in their names?

find /home/gshant -name '*.txt'

Which of the following commands finds files with the .txt extension in the /home/gshant directory?

cat turbo

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

apropos man -k whatis

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

echo $LANG

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

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

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

Which of the following commands sorts the contents of the wordlist1 and wordlist2 files and sends the result to standard output?

allfiles=$(ls -a)

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

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

Which of the following commands utilize command substitution? (Choose TWO.)

touch /home/gshants/smile

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

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

Which of the following commands will change the /home/pmallory/reports file's name to reports.bak?

lsattr /boot/grub/grub.conf

Which of the following commands will display the attributes of a /boot/grub/grub.conf file?

mv

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

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.

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

/root

Which of the following directories is the home directory for the root user account?

~/.bashrc ~/.profile

Which of the following files would you use to create aliases that are applied when a specific user starts a bash session? (Select TWO. Each answer is an independent solution.)

Valid inode for the file data even if the original file is deleted.

Which of the following is a characteristic of a hard link?

Distinct (non-duplicate) inode.

Which of the following is a characteristic of a symbolic link?

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

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

DESCRIPTION

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

^G (Ctrl+G)

Which of the following nano editor keyboard shortcuts will display help text which includes a list of all keyboard shortcuts

Keyboard shortcuts are displayed at the bottom of the editor

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

/

Which of the following paths represents the root directory?

Print server

Which of the following server roles would you implement to provide services offered by CUPS and IPP?

Using wildcards to match specific files.

Which of the following statement describes file globbing?

The FHS allows users to predict where to find system configuration files. The FHS allows software installation routines to predict where to place configuration files.

Which of the following statements BEST describe the purpose of the Filesystem Hierarchy Standard (FHS)? (Select TWO).

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

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

locate

Which of the following utilities would you use to search a path for files that match a given name?

<Esc>:wq

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

p

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 paste the copied text?

rm -r backup

Within the /var directory is a subdirectory named backup. Ken, a Linux administrator, needs to delete the directory backup and any files that it contains. He changes directory focus to /var. Which of the following commands deletes the directory named backup and any file it contains?

man uname

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?

find -size +300k

You need to find all files in the /home/gshant directory that are larger than 300K. You change your directory to /home/gshant. What would you enter at the command prompt to find these files?

export COMP=1745

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?

ls -a /home/jerrys

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?

export HOST

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

which photorec

You use a program on your Linux system called photorec. What would you enter at the command prompt to display the path to the photorec binary file?

PATH=$PATH:/sbin/special

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?

echo $HISTSIZE

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?

Containers

Your company develops applications to run on Linux systems. You currently have four teams 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 effecting your part of the project or your operating system and personal files?

Monitoring

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?

Clustering

Your company is running a critical business application. The executive team wants to ensure the server is available at all times, even in the event of a server failure. Which of the following server roles would be used to provide a failover server in the event of a system failure?

Certificate Authority

Your company recently setup a VPN and wants to use a digital certificate for authentication instead of a pre-shared key. Which of the following server roles would allow the company to provide this functionality internally instead of using an external provider?

File servers

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


Set pelajaran terkait

Chapter 25 Post-lecture (Proteins)

View Set

Ch. 5 normal anatomy of the female pelvis

View Set

ACTUAL FRENCH FINAL 10th grade chan

View Set

Chapter 4 - Life Insurance Riders

View Set

Preanesthetic period & anesthetic agents

View Set

NCLEX ® Delegation Questions

View Set

Chapter 14: Ways to build Confidence

View Set

Parasitic worms (Helminths) (Ch.12)

View Set

Les nationalités, les pays d'origine, le verbe être et le verbe venir

View Set