0.1.4 Course Introduction
You have just finished editing the grub file in the vi editor and want to change to the command-line mode, save the changes, and exit the editor. What would you enter in the vi editor to accomplish these tasks?
:wq (write quit)
The ls command displays the contents of a directory and includes several options. From the list of options on the left, drag an option to the correct definition on the right.
Displays directories but not files. -d Displays the contents of a directory and all of its subdirectories. -R Displays all directory contents, including hidden content. -a Displays extended information, including the owner, modified date, size, and permissions. -l
Which of the following are rules that apply to Linux files and directories? (Select three.)
The dot (.) in a filename is not necessary. The forward slash is used as a delimiter for a file or directory path. File and directory names are case-sensitive.
You are currently in the /home/kcole/personal directory. What command would you enter to change to the /home/kcole parent directory?
cd ..
You want to copy all the text files from the /home/kcole/documents directory to the /home/mruiz/personal directory. While copying the files, you want to be prompted before overwriting a file in the /home/mruiz/personal directory. What command would you enter to accomplish this task?
cp -i /home/kcole/documents/*.txt /home/mruiz/personal
You want to create a /sales/documents/quarterly_reports directory. The documents directory does not exist yet. What command would you enter to create the quarterly_reports directory?
mkdir -p /sales/documents/quarterly_reports
You want to rename the /home/kcole/documents directory to /home/kcole/personal. What command would you enter to perform this task?
mv /home/kcole/documents /home/kcole/personal Explanation
You want to remove the /home/kcole/documents directory with all its subdirectories and files without prompting. What command would you enter to accomplish this task?
rm -rf /home/kcole/documents You would enter the rm -rf /home/kcole/documents command to delete the documents directory with all its subdirectories and files without prompting.
Which of the following commands is designed to delete an empty directory?
rmdir The rmdir command is designed to delete an empty directory. The rm command removes the directory and file information from the file system, making the directories and files inaccessible. The mv command moves or renames directories (and files). The cd command changes the present working directory.
Which of the following commands would update the modification date and last accessed time for the /home/kcole/personal_info file?
touch /home/kcole/personal_info