https://killexams.com/pass4sure/exam-detail/LFCS
Download PDF for LFCS


LFCS MCQs

LFCS TestPrep LFCS Study Guide LFCS Practice Test

LFCS Exam Questions


Linux-Foundation


LFCS


Linux Foundation Certified System Administrator


https://killexams.com/pass4sure/exam-detail/LFCS

Download PDF for LFCS



Question #241

Given a file called birthdays containing lines like: YYYY-MM-DD Name -

1983-06-02 Tim

    1. 1995-12-17 Sue

      Which command would you use to output the lines belonging to all people listed whose birthday is in May or June?


      1. grep '[56]' birthdays

      2. grep 05?6? birthdays

      3. grep '[0-9]*-0[56]-' birthdays

      4. grep 06 birthdays | grep 05




Answer: C

Question #242

The script, script.sh, consists of the following lines:

#!/bin/bash echo $2 $1

Which output will appear if the command, ./script.sh test1 test2, is entered?


  1. test1 test2

  2. test2 test1

  3. script.sh test2

  4. script.sh test1

  5. test1 script.sh




Answer: B

Question #243

Which approach will provide a listing of the contents in a tar archive?


  1. Use the tar command with -t.

  2. Use the grep command.

  3. Use the find command.

  4. Use the zless command.

  5. Use the zlist command.




Answer: A

Question #244

Which character starts a comment line in a shell script file?


  1. ;

  2. *

  3. #

  4. /




Answer: C

What is the output of the following command sequence? for token in a b c; do

echo -n "$token "; done


  1. anbncn

  2. a b c

  3. "a " "b " "c "

  4. token token token

  5. abc




Answer: B

Question #246

What is the correct command to extract the contents of the archive file download.bz2?


  1. unpack download.bz2

  2. unzip2 download.bz2

  3. bunzip2 download.bz2

  4. unzip download.bz2

  5. uncompress download.bz2




Answer: C

Question #247

Which command chain will count the number of regular files with the name of foo.txt within /home?


  1. ls -lR /home | grep foo.txt | wc -l

  2. find /home -type f -name foo.txt | wc -l

  3. find /home -name foo.txt -count

  4. find /home -name foo.txt | wc -l

  5. grep -R foo.txt /home | wc -l




Answer: B

Question #248

Which of the following command sequences overwrites the file foobar.txt?


  1. echo "QUIDQUIDAGIS" >> foobar.txt

  2. echo "QUIDQUIDAGIS" < foobar.txt

  3. echo "QUIDQUIDAGIS" > foobar.txt

  4. echo "QUIDQUIDAGIS" | foobar.txt




Answer: C

Question #249

Which of the following commands redirects the output of cmd to the file foo.txt, in which an existing file is overwritten?


  1. cmd || foo.txt

  2. cmd | foo.txt

  3. cmd && foo.txt

  4. cmd >> foo.txt

  5. cmd > foo.txt



Answer: E

Question #250

What does the exit status 0 indicate about a process?


  1. The process ended without any problems.

  2. The process was terminated by the user.

  3. The process couldn't finish correctly.

  4. The process waited for an input but got none.

  5. The process finished in time.




Answer: A

Question #251

Which of the following commands will output all of the lines with the name Fred in upper or lower case but not the word red from the file data_file? (Choose two)


  1. grep -v fred data_file

  2. grep '[f]red' data_file

  3. egrep fred data_file

  4. grep '[Ff]red' data_file

  5. grep -i fred data_file




Answer: DE

Question #252

The output of the program date should be saved in the variable actdat. What is the correct statement?


  1. actdat=`date`

  2. set actdat='date'

  3. date | actdat

  4. date > $actdat

  5. actdat=date




Answer: A

Question #253

SIMULATION -

What two character sequence is present at the beginning of an interpreted script? (Please specify the TWO correct characters only)




Answer: #!

Question #254

How can the current directory and its subdirectories be searched for the file named MyFile.xml?


  1. find . -name MyFile.xml

  2. grep MyFile.xml | find

  3. grep -r MyFile.xml .

  4. less MyFile.xml

  5. search Myfile.xml ./




Answer: A

Which of the following commands will set the variable text to olaf is home? (Choose two)


  1. text=olaf\ is\ home

  2. text=$olaf is home

  3. $text='olaf is home'

  4. text=='olaf is home'

  5. text="olaf is home"




Answer: AE

Question #256

Which of the following commands will create an archive file, named backup.tar, containing all the files from the directory /home?


  1. tar /home backup.tar

  2. tar -cf /home backup.tar

  3. tar -xf /home backup.tar

  4. tar -xf backup.tar /home

  5. tar -cf backup.tar /home




Answer: E


KILLEXAMS.COM


Killexams.com is a leading online platform specializing in high-quality certification exam preparation. Offering a robust suite of tools, including MCQs, practice tests, and advanced test engines, Killexams.com empowers candidates to excel in their certification exams. Discover the key features that make Killexams.com the go-to choice for exam success.



Exam Questions:

Killexams.com provides exam questions that are experienced in test centers. These questions are updated regularly to ensure they are up-to-date and relevant to the latest exam syllabus. By studying these questions, candidates can familiarize themselves with the content and format of the real exam.


Exam MCQs:

Killexams.com offers exam MCQs in PDF format. These questions contain a comprehensive

collection of questions and answers that cover the exam topics. By using these MCQs, candidate can enhance their knowledge and improve their chances of success in the certification exam.


Practice Test:

Killexams.com provides practice test through their desktop test engine and online test engine. These practice tests simulate the real exam environment and help candidates assess their readiness for the actual exam. The practice test cover a wide range of questions and enable candidates to identify their strengths and weaknesses.


thorough preparation:

Killexams.com offers a success guarantee with the exam MCQs. Killexams claim that by using this materials, candidates will pass their exams on the first attempt or they will get refund for the purchase price. This guarantee provides assurance and confidence to individuals preparing for certification exam.


Updated Contents:

Killexams.com regularly updates its question bank of MCQs to ensure that they are current and reflect the latest changes in the exam syllabus. This helps candidates stay up-to-date with the exam content and increases their chances of success.