Comptia Linux+ LX0-103 Certification Exam Practice Test Set 2

You want to store the standard output of the ifconfig command in a text file (file.txt) for future reference, and you want to wipe out any existing data in the file. You do not want to store standard error in this file. How can you accomplish these goals?


Options are :

  • ifconfig 2> file.txt
  • ifconfig < file.txt
  • ifconfig > file.txt
  • ifconfig | file.txt
  • ifconfig >> file.txt

Answer : ifconfig > file.txt

Which of the following statements is true about binary RPM packages that are built for a particular distribution?


Options are :

  • They may be used in another RPM-based distribution only when you set the --convert-distrib parameter to rpm.
  • They may be used in another RPM-based distribution only after you recompile the package’s source RPM.
  • They can often be used on another RPM-based distribution for the same CPU architecture, but this isn’t guaranteed.
  • License requirements forbid using the package on any other distribution.
  • They can be recompiled for an RPM-based distribution running on another type of CPU.

Answer : They can often be used on another RPM-based distribution for the same CPU architecture, but this isn’t guaranteed.

CompTIA Security+ Cert. (SY0-501): Practice Tests 2019 Set 3

What is the effect of the following command? $ pr report.txt | lpr


Options are :

  • Tabs are converted to spaces in report.txt, and the result is saved in lpr.
  • None of the above.d
  • The file report.txt is formatted for printing and sent to the lpr program.
  • The file report.txt is printed, and any error messages are stored in the file lpr.
  • The files report.txt and lpr are combined together into one file and sent to standard output.

Answer : The file report.txt is formatted for printing and sent to the lpr program.

Which of the following is not an advantage of a source package over a binary package?


Options are :

  • Source packages can be installed more quickly than binary packages can.
  • You may be able to recompile source code for a non-Linux Unix program on Linux.
  • By recompiling a source package, you can sometimes work around library incompatibilities.
  • PamJones
  • A single source package can be used on multiple CPU architectures.

Answer : Source packages can be installed more quickly than binary packages can.

Which of the following commands will print lines from the file world.txt that contain matches to changes and changed?


Options are :

  • grep change[ds] world.txt
  • od “change’d|s’” world.txt
  • cat world.txt changes changed
  • sed change[d-s] world.txt
  • find world.txt “change(d|s)”

Answer : grep change[ds] world.txt

JK0-802 CompTIA A+ Certification Exam Set 1

You want to run an interactive script, gabby, which produces a lot of output in response to the user’s inputs. To facilitate future study of this script, you want to copy its output to a file. How might you do this?


Options are :

  • gabby | tee gabby-out.txt
  • gabby `gabby-out.txt`
  • gabby &> gabby-out.txt
  • gabby < gabby-out.txt
  • gabby > gabby-out.txt

Answer : gabby | tee gabby-out.txt

You type a command into bash and pass a long filename to it, but after you enter the command, you receive a File not found error message because of a typo in the filename. How might you proceed?


Options are :

  • Retype the command, and be sure you type the filename correctly, letter by letter.
  • Any of the above.
  • Press the Up arrow key, and use bash’s editing features to correct the typo.
  • None of the above.
  • Retype the command, but press the Tab key after typing a few letters of the long filename to ensure that the filename is entered correctly.

Answer : Any of the above.

Which is true of using both RPM and Debian package management systems on one computer?


Options are :

  • It’s a common practice on Red Hat and Debian systems.
  • It’s generally inadvisable because the two systems don’t share installed-file database information.
  • It causes no problems if you install important libraries once in each format.
  • Using both systems simultaneously requires installing the alien program.
  • It’s impossible because their installed-file databases conflict with one another.

Answer : It’s generally inadvisable because the two systems don’t share installed-file database information.

CAS-003 CompTIA Advanced Security Practitioner (CASP+) Exam Set 1

Which of the following commands will extract the contents of the myfonts.rpm file into the current directory?


Options are :

  • rpmbuild --rebuild myfonts.rpm
  • rpm2cpio myfonts.rpm > make-directories
  • rpm2cpio myfonts.rpm | cpio -i --make-directories
  • rpm -e myfonts.rpm
  • alien --to-extract myfonts.rpm

Answer : rpm2cpio myfonts.rpm | cpio -i --make-directories

In an xterm window launched from your window manager, you type exec gedit. What will happen when you exit from the gedit program?


Options are :

  • The xterm window will close.
  • Your shell will be a root shell.
  • A new instance of gedit will be launched.
  • The gedit program will terminate, but nothing else unusual will happen.
  • Your X session will terminate.

Answer : The xterm window will close.

What program would you use to display the end of a configuration file?


Options are :

  • uniq
  • wc
  • tail
  • cut
  • fmt

Answer : tail

CompTIA Cyber Security Analyst (CySA+) Practice Exams 2019 Set 5

A text-mode program, verbose, prints a lot of spurious “error” messages to standard error. How might you get rid of those messages while still interacting with the program?


Options are :

  • verbose &> /dev/null
  • verbose 2> /dev/null
  • verbose > junk.txt
  • verbose | quiet
  • quiet-mode verbose

Answer : verbose 2> /dev/null

Which of the following commands is implemented as an internal command in bash?


Options are :

  • sed
  • cat
  • echo
  • tee
  • less

Answer : echo

You type echo $PROC, and the computer replies Go away. What does this mean?


Options are :

  • Your central processing unit (CPU) is defective and must be replaced as soon as possible.
  • Your computer is handling too many processes; you must kill some of them to regain control of the computer.
  • You, one of your configuration files, or a program you’ve run has set the $PROC environment variable to Go away.
  • The remote computer PROC isn’t accepting connections; you should contact its administrator to correct the problem.
  • No currently running processes are associated with your shell, so you may log out without terminating them.

Answer : You, one of your configuration files, or a program you’ve run has set the $PROC environment variable to Go away.

Comptia Certification Collection

What is the effect of the following command?  $ myprog &> input.txt


Options are :

  • Standard error to myprog is taken from input.txt.
  • Standard input to myprog is taken from input.txt.
  • All of the above.
  • Standard output and standard error from myprog are written to input.txt.
  • None of the above.

Answer : Standard output and standard error from myprog are written to input.txt.

Which of the following regular expressions will match the strings dog, dug, and various other strings but not dig?


Options are :

  • d.g
  • d[o-u]g
  • d[ou]g
  • d.ig
  • di*g

Answer : d[o-u]g

What does the pwd command accomplish?


Options are :

  • It prints wide displays on narrow paper.
  • It prints the name of the working directory.
  • It prints wide displays on narrow paper.
  • It parses Web page URLs for display.
  • None of the Above
  • It prints the terminal’s width in characters.

Answer : It prints the name of the working directory.

CA1-001 CompTIA Advanced Security Practitioner Practice Exam Set 3

Which of the following commands will number the lines in aleph.txt?


Options are :

  • fmt aleph.txt
  • nl aleph.txt
  • od -nl aleph.txt

Answer : nl aleph.txt

What is the surest way to run a program (say, myprog) that’s located in the current working directory?


Options are :

  • Type the program name alone: myprog.
  • Type /. followed by the program name: /.myprog.
  • Type ./ followed by the program name: ./myprog.
  • Type run followed by the program name: run myprog.
  • Type the program name followed by an ampersand (&): myprog &.

Answer : Type ./ followed by the program name: ./myprog.

You’ve received an ASCII text file (longlines.txt) that uses no carriage returns within paragraphs but two carriage returns between paragraphs. The result is that your preferred text editor displays each paragraph as a very long line. How can you reformat this file so that you can more easily edit it (or a copy)?


Options are :

  • sed ‘s/Ctrl-M/NL/’ longlines.txt
  • fmt longlines.txt > longlines2.txt
  • cat longlines.txt > longlines2.txt
  • grep longlines.txt > longlines2.txt
  • pr longlines.txt > longlines2.txt

Answer : fmt longlines.txt > longlines2.txt

Comptia Linux+ LX0-103 Certification Exam Practice Test Set 6

Which of the following commands prints a list of usernames (first column) and their primary
group (fourth column) from the /etc/passwd file?


Options are :

  • cut -d : -f 1,4 /etc/passwd
  • split -c 1,4 /etc/passwd
  • fmt -f 1,4 /etc/passwd
  • paste -f 1,4 /etc/passwd

Answer : cut -d : -f 1,4 /etc/passwd

CompTIA JK0-801 A+ Certification Practical Exam Set 6

What is the maximum niceness value that a regular user can assign to a process with the
nice command when executing a new process?


Options are :

  • 9
  • 49
  • 19
  • 99

Answer : 19

Which of the following are valid stream redirection operators within Bash? 


Options are :

  • <
  • All the above
  • <<<
  • >

Answer : All the above

Which command displays a list of all background tasks running in the current shell?
(Specify ONLY the command without any path or parameters.)


Options are :

  • jobs

Answer : jobs

CompTIA Security+ (SY0-501) Practice Exams with Simulations Set 5

Which of the following commands displays the contents of a gzip compressed tar archive?


Options are :

  • tar ztf archive.tgz
  • tar cf archive.tgz
  • gzip -d archive.tgz | tar tvf -
  • gzip archive.tgz | tar xvf -

Answer : tar ztf archive.tgz

After moving data to a new filesystem, how can the former path of the data be kept intact in
order to avoid reconfiguration of existing applications?


Options are :

  • By creating an ACL redirection from the old to the new path of the data.
  • By creating a hard link from the old to the new path of the data
  • By creating a symbolic link from the old to the new path of the data
  • By running the command touch on the old path.

Answer : By creating a symbolic link from the old to the new path of the data

What is the output of the following command?
echo "Hello World" | tr -d aieou


Options are :

  • Hello World
  • Hll Wrld
  • eoo

Answer : Hll Wrld

220-701 A+ Essentials Certification Practice Exam Set 5

In compliance with the FHS, in which of the directories are man pages found?


Options are :

  • /usr/doc/
  • /opt/man
  • /var/pkg/man
  • /usr/share/man

Answer : /usr/share/man

What command will generate a list of user names from /etc/passwd along with their login
shell?


Options are :

  • chop -c 1,7 /etc/passwd
  • colrm 1,7 /etc/passwd
  • cut -d: -f1,7 /etc/passwd
  • column -s : 1,7 /etc/passwd

Answer : cut -d: -f1,7 /etc/passwd

Which of the following commands determines the type of a file by using a definition
database file which contains information about all common file types?


Options are :

  • pmagic
  • magic
  • type
  • . file

Answer : . file

CompTIA Security+ SY0-501 Questions & Answers Set 3

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions