|Exam Name||:||Linux Foundation Certified System Administrator|
|Questions and Answers||:||256 Q & A|
|Updated On||:||Click to Check Update|
|PDF Download Mirror||:||LFCS Brain Dump|
|Get Full Version||:||Pass4sure LFCS Full Version|
Given a file called birthdays containing lines like: YYYY-MM-DD Name -
Which command would you use to output the lines belonging to all people listed whose birthday is in May or June?
grep '' birthdays
grep 05?6? birthdays
grep '[0-9]*-0-' birthdays
grep 06 birthdays | grep 05
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?
Which approach will provide a listing of the contents in a tar archive?
Use the tar command with -t.
Use the grep command.
Use the find command.
Use the zless command.
Use the zlist command.
Which character starts a comment line in a shell script file?
What is the output of the following command sequence? for token in a b c; do
echo -n "$token "; done
a b c
"a " "b " "c "
token token token
What is the correct command to extract the contents of the archive file download.bz2?
Which command chain will count the number of regular files with the name of foo.txt within /home?
ls -lR /home | grep foo.txt | wc -l
find /home -type f -name foo.txt | wc -l
find /home -name foo.txt -count
find /home -name foo.txt | wc -l
grep -R foo.txt /home | wc -l
Which of the following command sequences overwrites the file foobar.txt?
echo "QUIDQUIDAGIS" >> foobar.txt
echo "QUIDQUIDAGIS" < foobar.txt
echo "QUIDQUIDAGIS" > foobar.txt
echo "QUIDQUIDAGIS" | foobar.txt
Which of the following commands redirects the output of cmd to the file foo.txt, in which an existing file is overwritten?
cmd || foo.txt
cmd | foo.txt
cmd && foo.txt
cmd >> foo.txt
cmd > foo.txt
What does the exit status 0 indicate about a process?
The process ended without any problems.
The process was terminated by the user.
The process couldn't finish correctly.
The process waited for an input but got none.
The process finished in time.
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)
grep -v fred data_file
grep '[f]red' data_file
egrep fred data_file
grep '[Ff]red' data_file
grep -i fred data_file
The output of the program date should be saved in the variable actdat. What is the correct statement?
date | actdat
date > $actdat
What two character sequence is present at the beginning of an interpreted script? (Please specify the TWO correct characters only)
How can the current directory and its subdirectories be searched for the file named MyFile.xml?
find . -name MyFile.xml
grep MyFile.xml | find
grep -r MyFile.xml .
search Myfile.xml ./
Which of the following commands will set the variable text to olaf is home? (Choose two)
text=olaf\ is\ home
text=$olaf is home
$text='olaf is home'
text=='olaf is home'
text="olaf is home"
Which of the following commands will create an archive file, named backup.tar, containing all the files from the directory /home?
tar /home backup.tar
tar -cf /home backup.tar
tar -xf /home backup.tar
tar -xf backup.tar /home
tar -cf backup.tar /home