152 CH 2.9
Which of the following commands can you use to combine the content of three files into a single text stream? pr cat cut nl
cat
Listen to exam instructions 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 home: cp /dev/usb/letter.doc /root cp /mnt/usb:letter.doc /root cp /media/usb/letter.doc /root
cp /media/usb/letter.doc /root
What would you enter at the command prompt to display a file's type?
file
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 ls -paged ls -p ls -l | less
ls -l | less
Which of the following commands displays the attributes of the /boot/grub/grub.conf file?
lsattr /boot/grub/grub.conf
Which of the following commands moves a file from one location to another? cp -d copy -r move mv
mv
Which of the following commands will change the /home/pmallory/reports filename to reports.bak? touch -n /home/pmallory/reports /home/pmallory/reports.bak rm /home/pmallory/reports /home/pmallory/reports.bak mv /home/pmallory/reports /home/pmallory/reports.bak cp -n /home/pmallory/reports /home/pmallory/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 rm -dir rm -i shred -v
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
Which of the following commands changes the /home/gshants/smile file's modification and last accessed times to the current time? cat /home/gshants/smile rm /home/gshants/smile ls /home/gshants/smile touch /home/gshants/smile
touch /home/gshants/smile