2.9.11 PQ

Ace your homework & exams now with Quizwiz!

What would you enter at the command prompt to display a file's type?

Explanation The file command shows the file type. You may use file often because Linux does not require file extensions. The file command uses file signatures in: /usr/share/misc/magic /usr/share/misc/magic.mgc /etc/magic

Which of the following commands can you use to combine the content of three files into a single text stream?

cat Explanation The cat command displays the contents of a file. If multiple files are added to the command, the contents of each file will be displayed in a single text stream.

A Linux administrator is logged in as root and needs to copy a file named letter.doc from the USB flash drive mounted under /media/usb. Which of the following commands will copy the file from the USB flash drive to the root user's home directory?

cp /media/usb/letter.doc /root

You attempt to view the contents of a directory, but the output of the ls -l command scrolls beyond the limit of one console window. Which of the following commands would allow you to see the full listing of the directory?

ls -l | less

Which of the following commands displays the attributes of the /boot/grub/grub.conf file?

lsattr /boot/grub/grub.conf Explanation The lsattr /boot/grub/grub.conf command displays the attributes of the file. The cat command displays the contents of the file. The vi command opens the file in the vi text editor. The ls -l command lists the permissions and ownership of the file.

Listen to exam instructions Which of the following commands moves a file from one location to another?

mv

Which of the following commands will change the /home/pmallory/reports filename to reports.bak?

mv /home/pmallory/reports /home/pmallory/reports.bak

An employee has mistakenly copied a secure, private file from a network directory to their local hard drive. You want to completely overwrite the file data on the hard drive, as well as delete the file inode (file metadata). Which of the following commands would you use to perform this task?

shred -u

A user, ljenkins, contacts the help desk about an error received while removing a file from their home directory. The user received the following error when trying to use the rm command to remove the file: [ljenkins@fileserver]$ rm report.txtrm: remove write-protected regular empty file 'myfile2.txt'? yrm: cannot remove 'myfile2.txt': Operation not permitted While troubleshooting the issue, you list files in the directory to see if you can discover the issue: [ljenkins@fileserver]$ ls -altotal 4drwxr-xr-x. 2 ljenkins ljenkins 24 Feb 25 12:04 .drwx 15 ljenkins ljenkins 4096 Feb 25 11:04 ..-rw-rw-r--. 1 ljenkins ljenkins 346 Feb 25 11:32 report.txt When prompted to remove the write-protected file, ljenkins entered yes and received an "Operation not permitted" error message. As the help desk technician, you attempt to remove the file with root privileges and receive the same error message. You decide to view the file at

sudo chattr -i report.txt && rm report.txt Explanation The directory listing shows that ljenkins has sufficient permissions to delete the file because ljenkins owns the file. Troubleshooting the issue further reveals that a user with root permissions cannot remove the file. The next step is to check the file attributes with the lsattr command. The lsattr command reveals that the file has the (i) immutable attribute set, which prevents even users with elevated privileges from deleting the file. sudo chattr -i report.txt && rm report.txt removes the immutable attribute and then deletes the file.

Which of the following commands changes the /home/gshants/smile file's modification and last accessed times to the current time?

touch /home/gshants/smile


Related study sets

ATI Pharmacology Proctored Review

View Set

4.2 Real vs Nominal Interest Rates

View Set

Global Studies Sub-Saharan Africa

View Set

Chapter 16: Policy and Compliance

View Set

Bio 210 Chapter 17 From Gene to Protein

View Set

MGT-332-Exam #1: Modules 1-5 (Chapters 1, 3-6)

View Set

Database Management I: Section 4-6 Test

View Set

Chapter 32: Labor and Birth Complications

View Set

Accident and health insurance Basics questions

View Set