Combo with "LabSim Linux+ 6.3" and 25 others

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

While in command mode, you need to find the term Sam. Which command should you use? (enter the command as if in the vi command mode)

/Sam

Under the Filesystem Hierarchy Standard (FHS), which directory contains the device files for a Linux system? (enter the full path of the directory)

/dev

You need to configure a few changes to how the locatedb index file is created. Which file should you edit? (enter the full path of the file)

/etc/updatedb.conf

Which directory holds the man files on the system? (enter the full path of the directory)

/usr/share/man

Which directory contains data files that change constantly, including e-mail, print jobs, and proxy cache files? (enter the full path of the directory)

/var/

You have an executable file named ni that allows you to save a snapshot of your network information with the date and time into a log file. The file is in the /root directory, and /root is the current working directory. How would you run the executable file? (select two) 1) ./ni 2) /root/ni 3) source ni 4) ni

1) ./ni 2) /root/ni

Which of the following represent the root directory? 1) / 2) /root 3) /boot 4) /home/root

1) /

What is the result of the uname -a command? 1) All system information is displayed on the screen. 2) Displays the current working directory. 3) Displays the current user name. 4) Shows names of files and directories in the current directory.

1) All system information is displayed on the screen.

What are two methods to exit vi from command mode? (select two) 1) Type ZZ 2) Type :wq 3) Type :e! 4) Type yy

1) Type ZZ 2) Type :wq

Which of the following command copies the entire /temp directory with all of it's files, sub-directories, and files in the sub-directories to the /home/gshant directory. (select two) 1) cp -r /temp /home/gshant 2) cp -s /temp /home/gshant 3) cp -R /temp /home/gshant 4) cp /temp /home/gshant

1) cp -r /temp /home/gshant 3) cp -R /temp /home/gshant

You are logged in as root. You have the file, letter.doc, on a CD in the first compact disk drive. Which command will copy the file from the CD to your home directory? 1) cp /mnt/scd0/letter.doc /root 2) cp /mnt/scd1/letter.doc /root 3) cp /mnt scd0/letter.doc home: 4) cp /mnt/cd1:letter.doc /root

1) cp /mnt/scd0/letter.doc /root

Which command shows the value of the environmental variable currently set for the terminal? 1) echo $TERM 2) echo TERM 3) echo %TERM% 4) echo %TERM

1) echo $TERM

Which of the following files will be displayed when using the egrep exhibit[0-9]+ ~/samps command? (select two) 1) exhibit1 2) exhibita45 3) exhibit1a12 4) exhibit125

1) exhibit1 4) exhibit125

You have an application called ABCD that is generating system errors when it starts. Which command is the best to search the system message log file for errors? 1) grep ABCD /var/log/messages 2) display ABCD /var/log/messages 3) tail -n25 /var/log/ABCD.log 4) tail -n25 /var/log/messages 5) top /var/log/ABCD.log

1) grep ABCD /var/log/messages

You have a group named temp_sales on your system. The group is no longer needed, and you should remove the group. Which of the following commands should you use? 1) groupdel temp_sales 2) newgroup -R temp_sales 3) groupmod -n temp_sales 4) groupmod -R temp_sales

1) groupdel temp_sales

What command should you enter to see a list of all the commands you recently used at the command prompt? 1) history 2) clear 3) uname 4) chsh

1) history

You need to find a specific file on your linux system. Which of the following commands should you use? (select two) 1) locate 2) find 3) which 4) whereis

1) locate 2) find

Which command would you use to move a file from one location to another? 1) mv 2) copy -r 3) cp -d 4) move

1) mv

In the /var directory is a sub-directory called backup. You need to delete the directory backup and any files. You change directory focus to /var. Which command will delete the directory backup and its files? 1) rm -rf backup 2) rm backup/*.* 3) rm backup 4) rd -rf backup/*.*

1) rm -rf backup

You need to create a new text file with the name network.txt in the current directory. Which command starts vi and creates the file? 1) vi network.txt 2) vi :w network.txt 3) vi -n network.txt 4) vi -new network.txt

1) vi network.txt

Which of the following files would you use to create aliases that are applied when a specific user starts a BASH session? (select two) 1) ~/.profile 2) /etc/profile 3) ~/.bashrc 4) ~/.bash_logout

1) ~/.profile 3) ~/.bashrc

Under the Filesystem Hierarchy Standard (FHS), which directory contains information about the system state and processes? 1) /bin 2) /proc 3) /root 4) /tmp

2) /proc

Which directory is the home directory for the root user account? 1) /home/root 2) /root 3) /home 4) /

2) /root

You have opened the /root/myscript file in vi. While looking at the file, your soda spilled, and you hit several keys on the keyboard trying to pick it back up. There are extra characters everywhere in the file, and you know you can't fix it. How do you exit vi without saving the changes? 1) :wq 2) :q! 3) :x 4) :q

2) :q!

Which key combination should you press in vi to save the file you are working on and quit? 1) S 2) :wq 3) s 4) :q

2) :wq

Which of the following options is the standard shell for most Linux computers? 1) tcsh 2) Bourne-again shell (bash) 3) Bourne shell 4) Korn 5) C-shell

2) Bourne-again shell (bash)

Which of the following is not a characteristic of hard links? 1) Dash (-) as the first character in the permission string. 2) Distinct inode 3) Valid inode for the file data even if the original file is deleted. 4) Indistinguishable from the original files.

2) Distinct inode

Which of the following statements best describe the purpose of the Filesystem Hierarchy Standard (FHS)? (select two) 1) during installation, software can determine the permissions of specific directories. 2) During installation, software can predict where to place configuration files. 3) Individual users can predict where to find system configuration files. 4) As users create files, they are forced to place the files in specific directories.

2) During installation, software can predict where to place configuration files. 3) Individual users can predict where to find system configuration files.

Which of the following statements best describes the PATH environment variable? 1) It specifies the filename where past commands are stored. 2) It contains the directory prefixes used to search for programs and files. 3) It contains the path of the current working directory. 4) It specifies the characters the shell uses to indicate normal user ($), root user (#) and similar items.

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

What is the purpose of the find command? 1) Display the path to the binary files, the manual pages, and the source code. 2) Search for files in the file system based on name, file size, time created, and other options. 3) Display the path to a command and determine whether a package is installed. 4) Search an index file for specific parameters.

2) Search for files in the file system based on name, file size, time created, and other options.

You made a few changes to the /grub/grub/grub.conf file and now you need to exit out of insert mode, save the changes, and quit. What should you do? (Select two) 1) Type :w! 2) Type :wq 3) Type :q! 4) Press Esc

2) Type :wq 4) Press Esc

Which of the following commands will cut an entire line from a file while in the vi command line mode? 1) de 2) dd 3) yy 4) C

2) dd

Which of the following commands would you use to find all of the files on the system that have either blue or gold in their names? 1) find . -name '*b*' -o '*gold*' 2) find / -print0 '*blue*' -o '*gold*' 3) find .. -name '*blue*' -o '*gold*' 4) find .. -print0 '*blue*' -o '*gold*'

2) find / -print0 '*blue*' -o '*gold*'

Which of the following commands finds files with the .txt extension in the /home/gshant directory 1) find /home/gshant -name '*txt*' 2) find /home/gshant -name '*.txt' 3) find /home/gshant -type d -name '*text*' 4) find /home/gshant -type f -name '*text*'

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

You want to perform an audit and make sure that group membership for user dblair is correct. Which command would you use to view the groups that dblair is a member of? 1) grep -e dblair /etc/passwd 2) grep -e dblair /etc/group 3) members dblair 4) group dblair

2) grep -e dblair /etc/group

You need to quickly see all of the lines in the blue_and_gold text file that do not reference Karen. Which command would you use to accomplish this? 1) grep -n Karen blue_and_gold 2) grep -v Karen blue_and_gold 3) grep -n blue_and_gold Karen 4) grep -v blue_and_gold Karen

2) grep -v Karen blue_and_gold

You are the administrator for a small company. You need to add a new group of users, named sales, to the system. Which command will accomplish this? 1) groupadd -r sales 2) groupadd sales 3) addgroup -x sales 4) addgroup sales

2) groupadd sales

Which command prints the attributes of a /boot/grub/grub.conf file? 1) vi /boot/grub/grub.conf 2) lsattr /boot/grub/grub.conf 3) cat /boot/grub/grub.conf 4) ls /boot/grub/grub.conf

2) lsattr /boot/grub/grub.conf

While in command mode, you copied a whole line of text to memory. You navigated to a different location in the file, and now you need to place the line of text. what command should you use? 1) u 2) p 3) cc 4) dw

2) p

Which of the following utilities displays the category of a command? 1) whereis 2) type 3) which 4) find

2) type

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 file would you place this variable in? 1) .bash_profile 2) /etc/profile 3) .bash_login 4) .bashrc

3) .bash_login

A user is requesting that each time she logs in, a particular entry be written to a log file. This will only apply to her and she is using the Bash shell. In which configuration file would you make an entry for this action to take place? 1) .sh 2) /etc/profile 3) .profile 4) .bashrc

3) .profile

Which of the following would be the result of the command ln -b ~/file1 /data/file1? 1) A link called /data/file1 would be created and would always be treated by the operating system as a binary file despite the type of file it points to. 2) The ln command would test to see if the source file was a binary file or text file before creating the link. 3) A copy of the file ~/file1 would be placed in /data. 4) The -b option would only work if the file being linked to is a binary file not a text file.

3) A copy of the file ~/file1 would be placed in /data.

Which of the statements describe file globbing? 1) Indexing files for the locate command. 2) Displaying which commands use specific files. 3) Using wildcards to match specific files. 4) Determining the category of the file or command.

3) Using wildcards to match specific files.

Which of the following commands combines three files into a single text stream? 1) pr 2) cut 3) cat 4) nl

3) cat

You need to make an expanded listing of all the files in /etc. Which command will produce the listing? 1) dir -al /etc 2) ls -ae /etc 3) ls -al /etc 4) ld -ae /etc

3) ls -al /etc

After using the ls command in the current working directory, you notice the following files; lrwxrwxrwx 1 root root 4 2010-11-05 myfile -> shantsgems -rwxr-xr-x 1 root root 382 2010-10-05 shantsgems What is true about about the files? 1) myfile is a piped link to shantsgems. 2) myfile is a hard link to shantsgems. 3) myfile is a symbolic link to shantsgems. 4) myfile is a backup file to shantsgems.

3) myfile is a symbolic link to shantsgems.

You are looking for a specific five-character string in the ~/customquote file with the grep command. The string should begin with the letter g, end with a y, and be the last string on the line. Which regular expression should you use with grep? 1) "&g...y" 2) "g..y.$" 3) "g..$.y" 4) "g...y$"

4) "g...y$"

Which of the following commands will configure the shell to retain 300 recently-used commands in the ~/.bash_history file for multiple shell sessions? 1) HISTSIZE=300 2) BASH=300 3) HISTFILE=300 4) HISTFILESIZE=300

4) HISTFILESIZE=300

You want the directory /sbin/special to always be a part of the PATH. You always want to keep all the current entries in your PATH statement. Which of the following commands would you use? 1) PATH=$PATH:$/sbin/special 2) PATH=PATH&/sbin/special 3) PATH=/sbin/special 4) PATH=$PATH:/sbin/special

4) PATH=$PATH:/sbin/special

Which of the following presents the greatest security risk? 1) The system has a large file named core. 2) The second field for every user in the /etc/passwd file is x. 3) There are several disabled user accounts. 4) The PATH statement includes . (period).

4) The PATH statement includes . (period).

You previously created symbolic links in your home directory to a set of files in the /data directory using the ln -s command. The system administrator has just deleted those files. What happens to the links that you created? 1) The links in your home directory would disappear because the files that they were linked to are now gone. 2) You would still be able to access the files until the system is rebooted even though they are deleted because the links keep a cached copy of them in memory. 3) The files would not be deleted because you created duplicate entries into the file system when you created the links. 4) The symbolic links would still exist in your home directory but they would now be broken.

4) The symbolic links would still exist in your home directory but they would now be broken.

You want to view the number of commands your HISTSIZE environment variable is set to save. You don't want to have to scroll through all the environment variables. Which command shows you the value for the HISTSIZE variable? 1) cat /etc/profile I grep "HISTSIZE" 2) HISTSIZE= 3) cat $HISTSIZE 4) echo $HISTSIZE

4) echo $HISTSIZE

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 command will display all the environment variables? 1) print 2) echo 3) display 4) env

4) env

You need to set the COMP variable to the value 1745. Which command will set the variable so it is available to other shell programs? 1) COMP=1745 2) set COMP=1745 3) set COMP to 1745 4) export COMP=1745

4) export COMP=1745

You recently used the HOST=FS4 command. What command should you use to make the environment variable to apply to all child sessions? 1) env HOST 2) unset HOST 3) set HOST 4) export HOST

4) export HOST

Due to a merger with another company, standardization is now being imposed throughout the company. as a result of this, sales group must be renamed marketing. Which of the following commands will accomplish this? 1) grpchange marketing sales 2) grpconv marketing sales 3) groupadd -c marketing sales 4) groupmod -n marketing sales

4) groupmod -n marketing sales

Which of the following utilities would you use to search the path for files matching a given name? 1) cat 2) type 3) tail 4) locate

4) locate

You want 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? 1) ls -l >> less 2) ls -p 3) ls -paged 4) ls -l | less

4) ls -l | less

You need to create the directory /var/oracle/database/9i. Only the directory /var currently exists. From the root of the filesystem, which command will create the directory path? 1) md -path /var/oracle/database/9i 2) mkdir /var/oracle/database/9i 3) mkd /var/oracle/database/9i 4) mkdir -p /var/oracle/database/9i

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

Which command would you use to rename the /home/pmallory/reports file to reports.bak? 1) diff -n /home/pmallory/reports /home/pmallory/reports.bak 2) touch -n /home/pmallory/reports /home/pmallory/reports.bak 3) ren /home/pmallory/reports /home/pmallory/reports.bak 4) mv /home/pmallory/reports /home/pmallory/reports.bak

4) mv /home/pmallory/reports /home/pmallory/reports.bak

You are editing a text file with vi and need to open a new line above the one you are currently working on. What key should you press to accomplish this? 1) a 2) p 3) i 4) o

4) o

Which of the following commands will change the /home/gshants/smile file's modification and last accessed times to the current time? 1) rm /home/gshants/smile 2) cat /home/gshants/smile 3) ls /home/gshants/smile 4) touch /home/gshants/smile

4) touch /home/gshants/smile

Which single command should you use to find the path and manual pages for the mycustomapp program? 1) whereis -b mycustomapp 2) whereis -m mycustomapp 3) whereis -s mycustomapp 4) whereis mycustomspp

4) whereis mycustomspp

After a user starts a BASH session and the scripts in /etc/profile are applied, what is the next file that could affect the shell session? 1) ~/.bash_logout 2) ~/.bash_login 3) ~/.profile 4) ~/.bash_profile

4) ~/.bash_profile

Which of the following files would not be found by the locate -i LibraryFines.csv command? 1) 1 libraryFines.csv 2) LibraryFines.csv 3) Libraryfines.csv 4) libraryfines.csv 5) libraryfines.csv1

5) libraryfines.csv1

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 in command line mode takes you directly to line 82? (enter the command as if in the command mode)

82

After opening a file in vi, you want to switch from command mode to command line mode. What key should you enter?

: (colon)

Match the vim mode on the left to the correct definition on the right. Edit mode The initial vim mode used when vim 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 mode that vim uses to write and edit text in the file. Command line mode The mode that works with the file system. Use it to save files after editing them.

Edit mode - The mode that vim uses to write and edit text in the file. Command mode - The initial vim mode used when vim is started. It has commands that cut and replace text, and it is the mode vi uses to enter the other modes. Command line mode - The mode that works with the file system. Use it to save files after editing them.

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

HISTSIZE

Match the command on the left with the description on the right to navigate while in vi command mode. Move the cursor up a line ----------------------h Move the cursor one space to the left ------ l Move the cursor one space to the right ------j Move the cursor down a line -------------------k

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

What line must you add to /etc/profile to make sure /sbin/custom is always part of the PATH, but also keep all the current entries in the PATH statement? (enter the commands as if at the command prompt)

PATH=$PATH:/sbin/custom:export PATH

What will affect the following command? ls -l /usr/bin >> /tmp/list.txt

The contents of the /usr/bin directory will be redirected into a file called /tmp/list.txt, inserted after previous contents of the file

You are working at the command line and need to start a new Bourne-again shell (bash) session. What should you type? (enter the command as if at the command prompt)

bash

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

cat /usr/wordlist1 /usr/wordlist2 | sort

Which of the following commands displays the contents of wordlist1 and wordlist2 then sorts the combined contents, then sends the results to the monitor and a file named sortedwordlist?

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

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

cat turbo

Which of the following commands redirects output to standard error?

cat txtfile 1>&2

You are searching the standard input for any line containing JAMESTOWN at the end of a line. Which egrep constructor should you use? (type the command as if at the command prompt)

egrep JAMESTOWN $

Which command will display only the environment variables applied to child sessions?

env

You have the myapp executable file. It is found in the current directory, but not in the command path. What should you type at the command prompt to start the myapp file and replace the shell with myapp process? (enter the command as if at the command prompt)

exec./myapp

Which command will display a files type? (enter the command as if at the command prompt)

file

You need to find all files in the /home/gshant directory that are larger than 300k. You change directories to /home/gshant. What command should you use? (enter the command as if at the command prompt)

find -size+300k

Which command will only display the primary and secondary group membership for the gshant user account? (enter the command as if at the command prompt)

groups gshant

Drag the permission string on the left to the category on the right. (some permission strings will not be used) lrwxrwxrwx drwxr-xr-x Symbolic link -rwxr-xr-x Hard link srwxr-xr-x prwxr-xr-x

lrwxrwxrwx Symbolic link -rwxr-xr-x Hard link

You need to view the contents of the /home/jerrys directory. Which command will show all the contents, including hidden files and directories? (only include the necessary command options)

ls -a /home/jerrys

You are trying to debug a shell script that has the command ls -s in it. You suspect an error is occurring here and want to sent the results of the operations (successful or error) to a file name -Friday- in order to examine it later. Which commands should you use?

ls -s> Friday 2>&1

you are working on a Linux system and need more information about the uname command. what command should you use to learn about the uname command syntax and options.

man uname

You are trying to debug a shell script called myscript and to aid you in this task you would like to have the output of the script be recorded in a text file. Which command would satisfy your requirements?

myscript >> testfile.txt

Which command will display the present working directory? (enter the command as if at the command prompt)

pwd

The /home/gshant/smp directory contains several files.The directory and files need to be removed. You change directories to /home/gshant. Which command should you use? (enter the command as if at the command prompt)

rm -r smp

The /home/gshant/smp directory is empty and needs to be removed. you change directories to /home/gshant. Which command should you use? (enter the command as if at the command prompt)

rmdir smp

Which command will display all the environment variables on the system?

set

Which command reads from standard input and writes to standard output and files?

tee

After using the locate command, you discover some of your files are not being listed in the search results. Which command should you use to update the /var/log/locatedb file? (enter the command as if at the command prompt)

updatedb

Which of the following commands could you use to search man pages for a specific keyword *(select three) whatis man -k apropos find slocate

whatis man -k apropos

You use a program on your Linux system named photorec. Which command will display the path to the photorec binary file? (enter the command as if at the command prompt)

which photorec

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

xargs

While in vi command mode, you need to copy an entire line of text. What command should you use? (enter the command as if in the command mode)

yy

Which symbol uses the output of one command as the input of another command?

|


Kaugnay na mga set ng pag-aaral

World Religions Exam 1 Homework Questions

View Set

Plato - Forensics Mid-Term | Study Guide

View Set

Chapter 41: Management of Patients with Musculoskeletal Disorders

View Set

EMT Geriatrics and Special Populations Practice Questions

View Set

NSG 245 Ch 41- Management of Musculoskeletal Disorders

View Set

Digital forensics chapters 1 and 4 review questions

View Set

Money and Banking Exam 1 Practice Test

View Set

Chapter 16: Care of Patients Experiencing Urgent Alterations in Health

View Set

MTH 115 - Review for Test 3 - Szalankiewicz

View Set

Computing - Data representation (binary and hexadecimal)

View Set