CompTIA Linux+ Practice Questions: File Management

11 free, exam-style CompTIA Linux+ (XK0-006) practice questions covering File Management, each with the correct answer and an explanation. Start a timed exam below, or scroll on to read through the questions.

🧠

Mini Exam

25 Questions · 50 minutes

Start Quiz 🚀
🏆

Mock Linux+ Exam

85 Questions · 165 minutes

Start Quiz 🚀
📅

Daily Quiz

10 Questions · 20 minutes

Start Quiz 🚀
🎯

Standard Practice

50 Questions · 100 minutes

Start Quiz 🚀

File Management practice questions

Answers and explanations are shown. Take the timed exam above to test yourself first.

Q1. Which command lists all files/directories including hidden ones?

  • A.ls -a✓ Correct
  • B.ls -l
  • C.ls -R
  • D.ls -d
Explanation: The -a flag shows all entries, including those starting with . Learn more.

Q2. What command permanently deletes a file?

  • A.rm✓ Correct
  • B.shred
  • C.unlink
  • D.mv /dev/null
Explanation: rm removes directory entries (use shred for secure deletion). Learn more.

Q3. What is the purpose of 'rsync -a'?

  • A.Archive mode (preserve permissions)✓ Correct
  • B.Compress data
  • C.Delete source files
  • D.Show progress
Explanation: -a enables archive mode (recursive + preserve attributes). Learn more.

Q4. What does 'tar xvzf' do?

  • A.Extract verbose gzip tar✓ Correct
  • B.Create tar archive
  • C.Compress with xz
  • D.List archive contents
Explanation: x=extract, v=verbose, z=gzip, f=file. Learn more.

Q5. What command updates locate database?

  • A.updatedb✓ Correct
  • B.locate --update
  • C.find / -update
  • D.mlocate refresh
Explanation: updatedb refreshes the mlocate database. Learn more.

Q6. Which command changes file timestamps?

  • A.touch✓ Correct
  • B.chtime
  • C.timedatectl
  • D.stat
Explanation: touch updates access/modification times. Learn more.

Q7. Which command creates a compressed archive using xz?

  • A.tar -czf
  • B.tar -cJf✓ Correct
  • C.tar -cjvf
  • D.zip -r
Explanation: -J uses xz compression (creates .tar.xz file). Learn more.

Q8. What does 'rsync --delete' do?

  • A.Delete source files after transfer
  • B.Remove extraneous files from destination✓ Correct
  • C.Force checksum comparison
  • D.Encrypt transfer
Explanation: Syncs destination to mirror source exactly. Learn more.

Q9. Which command searches for files by name, type, size, or other attributes?

  • A.find✓ Correct
  • B.sort
  • C.uniq
  • D.cut
Explanation: find traverses directories and locates files matching specified criteria. Learn more.

Q10. Which archive command creates a gzip-compressed tar archive?

  • A.tar -czf archive.tar.gz directory✓ Correct
  • B.zip -d archive.tar.gz directory
  • C.dd if=directory of=archive
  • D.mount -a archive
Explanation: tar -czf creates an archive and compresses it with gzip. Learn more.

Q11. Which command estimates the size of a directory tree?

  • A.du -sh directory✓ Correct
  • B.lsmod directory
  • C.ip addr directory
  • D.systemctl directory
Explanation: du summarizes disk usage, and -sh gives a human-readable total for a path. Learn more.

More CompTIA Linux+ practice topics

Keep studying CompTIA Linux+

Full CompTIA Linux+ practice exam · CompTIA Linux+ study guide · All CompTIA practice questions

Last updated