Comptia Cheese
23 community-sourced questions and answers. Free — no login.
What command will return the value of the variable PATH in the shell?
echo $PATH
What options will return the contents of the variable myVar?
echo $myVar
Complete the code to use the cpio command to extract the files from /images.cpio and place them in that same directory, recreating any required subdirectories.
-i -d ??
Write the command that will copy all subdirectories recursively in /images in the backup folder /imgbak
cp -r /images /imgbak
You've opened a text file using vi and now you want to search for instances of the string mark. As mark can be a verb as well as a name you want to make your search case insensitive. Which option will perform this query?
/mark\c
Which command will modify the date and time stamp on an existing file?
touch [a-z][a-z][a-z]0?
Write the command that would return any files owned by emclampett that are in the /images directory
find /images -user emclampett
You've run history command in the bash shell and now you want to execute the command listed 39th. Which option will do this?
!39
Which component of this command will specify the path and name of the file in which all of the archived files will exist? tar -zcvf /images.tar
f
You want to search cheese.txt for instances of the string blue, but you don't want the search to be case sensitive.
-i
Which of the following commands will open the mainlist.txt text file in a command-line text editor?
vi mainlist.txt
Which operator could you use to mimic an IF statement on the command line?
ll
Using gedit as your text editor, complete the query to search the snacks directory and open the files inside. find /home/snacks/*.txt |
gedit??
Complete the code to recursively copy all files in the current directory to the /backup001 directory. Make sure the code also returns what files have been copied.
-rv?? Maybe just -v
Which command will remove the files and directories recursively from /images without prompting for confirmation before removing each file?
rm -rv /images
Write the command to compress every file contained in the /images directory using the fastest compression command.
gzip -r /images
Which option will return all files including hidden ones?
ls -a ~
Complete the command that will add the /images directory to the PATH variable
/images ??
You used to vi to open a text file and now you want to edit it. What options represent the keys you can press that will allow you to actually edit the contents?
i a
Which statement about the piping of output is accurate?
Piping is accessed using the | symbol
Which command will allow you to reopen a file without saving any changes?
:e!
Which statement best describes the purpose of the tee command
It allows you to write standard output to the screen and additional locations
Which command will allow you to replace the string red with the string blue in a text file without being asked for confirmation?
:%s /red/blue
Looking for a different version?
CBTs get updated every year. Search for the exact version you're taking (e.g. "cyber awareness 2025").
Search all study materials