Ch3-4-Quiz

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

In order to move from the /home/joe/test/data to the /home/joe directory, what command should be issued? cd .. cd ../.. /home/joe cd ./..

cd ../..

What command can be issued to confirm which directory you are in at a command line prompt? dir pwd whereami ld

pwd

The Filesystem Hierarchy Standard specifies what directory as the root user's home directory? /bin /home/root /boot /root

/root

What is the complete path and filename for the database that is used by the locate and mlocate commands? /var/lib/mlocate/mlocate.db /var/lib/locate/locate.db /etc/mlocate.db /etc/locate/mlocate.db

/var/lib/mlocate/mlocate.db

At the vi command mode prompt, what key combination will force a quit from the vi editor without saving changes? :q :q! :exit :!

:q!

When using the vi text editor, which of the following keys, when in command mode, will change to insert mode and place the cursor at the end of the current line? i a I A

A

When using the vi text editor, which of the following keys, when in command mode, will move to the last line in the document? G L P W

G

If enough unique letters of a directory name have been typed, what key can be pressed to activate the BASH shell's completion feature? Alt Tab Ctrl Esc

Tab

If a hard link is created to a file and then the original file is deleted, which of the following is true? Both the original file and the hard link are removed. An error message will be displayed preventing the deletion of the original file. The original file will be removed while the hard link remains, though the content will not be accessible. The original file will be removed while the hard link remains usable to access the contents of the file.

The original file will be removed while the hard link remains usable to access the contents of the file.

What would be the result of running the command chown :root file1.txt This would set the owner of file1.txt to root. This would set the group ownership of file1 to root. This would set the owner and group ownership of file1 to root. This would keep the current ownership of the file, and add root as a second owner of the file.

This would set the group ownership of file1 to root.

In order to set all of the special permissions on a certain file or directory, which command should be used on a file named filename? chmod 777 filename chmod 7777 filename chmod 6666 filename chmod 0000 filename

chmod 7777 filename

Which of the following commands can be used to recursively search a directory tree for files that meet a certain criterion without using a database or premade index of files? locate find where search

find

Which of the following commands can be used to recursively search through the directory tree in search of a file that meets a set of given criteria instead of using an indexed database? locate mlocate find where

find

Which of the following commands will display all files and directories within the /var/log directory or its subdirectories which are owned by the root user? (Choose two.) find /var/log -user root find -uid root -print /var/log find -user root -print /var/log find -path /var/log -user root

find /var/log -user root

Garrett wants to search through a csv file to find all rows that have either the name John or Bob in them and display them out to the terminal. Which of the following commands could Garrett use to perform this search? grep -E "(John|Bob)" salesemployees.csv grep (John|Bob) salesemployees.csv grep -E (John|Bob) salesemployees.csv egrep (John|Bob) salesemployees.csv

grep -E "(John|Bob)" salesemployees.csv

Jo has received a text file which contains multiple instances of his name spelled correctly as well as multiple instances spelled as Joe. Which of the following commands would search a text file for any occurrences of either spelling and display them out to the terminal? (Choose three.) grep "Joe?" document1.txt grep -E "Joe?" document1.txt grep "Joe*" document1.txt grep -E "Joe*" document1.txt

grep -E "Joe?" document1.txt grep "Joe*" document1.txt grep -E "Joe*" document1.txt

Which of the following permissions would show for a symbolic link when displayed with the ls -l command? -rw-r--r-- srwxrwxrwx lrwxrwxrwx srw-r--r--

lrwxrwxrwx

Select the command that can be used to provide a long listing for each file in a directory: ls -T ls -L ls -F ls -I

ls -I

Jamie has created a hard link to another file within the same directory. Which of the following commands can he use to verify that the hard link was created correctly? (Choose all that apply.) ls -il ls -i ls -l ls -al

ls -il ls -i

Mindy wants to create a new subdirectory at ~/2019projects/projectx/projectplans to start storing the initial project plans for projectx. However, this is the first project she has worked on in 2019 and the 2019projects directory does not exist yet. Which of the following commands will create the higher level directories if they do not already exist? mkdir -r ~/2019projects/project/projectplans mkdir -p ~/2019projects/project/projectplans mkdir --all ~/2019projects/project/projectplans mkdir -v ~/2019projects/project/projectplans

mkdir -p ~/2019projects/project/projectplans

Jim wants to rename a directory for a project that he has been working on. Which of the following commands can he use to perform that action? mv projectx projecty rename projectx projecty ren projectx projecty move projectx projecty

mv projectx projecty

Mike has changed directory into one subdirectory after the next and has lost track of where he's at in the directory tree. Which of the following commands can he use to tell him the full path to the current subdirectory he is in? cd - pwd cwd ls -dir

pwd

Which of the following commands will delete a directory and all of the files contained within it? (Choose all that apply.) rm olddir rmdir olddir rm -rf olddir rmdir -rf olddir

rm -rf olddir

What command is most effective at identifying different types of files? stat ls -l ll file

stat

o display a text file in reverse order, what command should be used? cat tac tee sed

tac

What command can be used to display the last five lines of a text file? end -5 head -5 stop -5 tail -5

tail -5

When issuing the ls -F command, what special character indicates a linked file? @ * & =

@

Lynn runs the locate command and the results include many files from a directory that she doesn't want to include in her search. Which of the following files could Lynn modify so that the locate command no longer includes those results? /etc/locate.d/updatedb.conf /etc/locate.conf /etc/updatedb.conf /etc/locatedb.conf

/etc/updatedb.conf

Which of the following key combinations, commonly used in the vi editor command mode, displays current line statistics? $ x Crl+g P

ctrl+g

Kate wants to compare two text files to identify what might have been changed from one version to another. Which of the following commands can she use to do this? a) match document1.txt document2.txt b) version --compare document1.txt document2.txt c) compare document1.txt document2.txt d) diff document1.txt document2.txt

d) diff document1.txt document2.txt

Which of the following are valid permissions for a directory where the command chmod 1777 has been used to set the permissions on it? drwxrwxrwt Srwxrwxrwx trwxrwxrwx drwxrwxrw-

drwxrwxrwt

Which of the following commands will create a symbolic link named foo.txt to an original file named bar.txt ln bar.txt foo.txt ln foo.txt bar.txt ln -s bar.txt foo.txt ln -h foo.txt bar.txt

ln bar.txt foo.txt

Nicholas wants to verify whether a file is a hard link to a file within the same directory. Which of the following commands could he use to see information that would be helpful to make this determination? ls -s ls -l ls -al ls -i

ls -i

Which of the following commands will return one result of where the grep binary executable is located? (Choose two.) which grep locate grep type grep find grep

which grep type grep


संबंधित स्टडी सेट्स

Chapter 5: Gross Income and Exclusions

View Set

Residential Construction and the Appraiser

View Set

Chapter 15: Influence, Empowerment, and Politics

View Set

Routes, Emergency Action Plans, Fire Protection Plans, and Fire Protection OSHA 10 hour General Industry Exits

View Set

Antepartum, Reproduction and Sexuality Unit #2

View Set

BIOL1101 - evolution and biological diversity

View Set

Skeletal System - Arms and Shoulder and Hand Bones

View Set

PN 2: Exam 3 COMBO (End of ch. Q's, Pwpt, JulieYang)

View Set

Kansas-Nebraska Act/bleeding Kansas

View Set