According to the scenario, since John wants to copy all files with the .dat extension from /home/john
to /home/maria while preserving the file
attributes such as timestamps, mode, and ownership, he will use the cp -p /home/john/*.dat
/home/maria command to accomplish the task. The cp -p command copies files from source to destination while preserving the file attributes, such as timestamps, mode, and ownership.
Answer option B is incorrect. The cp -R /home/john/*.dat /home/maria command will recursively copy all .dat files from source to destination; however, it will not preserve the file attributes.
Answer option D is incorrect. The cp -l /home/john/*.dat /home/maria command will link all .dat
files from /home/john to /home/maria instead of copying them.
Answer option C is incorrect. The cp -l /home/maria/*.dat /home/john command will link all .dat
files from /home/maria to /home/john instead of copying them.
Submit