Linux Fundamentals - Creating and Removing Directories and Files

Linux Fundamentals - Creating and Removing Directories and Files

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

This tutorial covers basic file and directory operations in a Linux environment. It explains how to create directories and subdirectories using the mkdir command, including the use of the -p option to create parent directories. The video also demonstrates how to remove directories and subdirectories with the rm command using the -r option. Additionally, it shows how to create files using the touch command and add content to files with the echo command. The tutorial concludes with a cleanup of the created directories and files.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command is used to create a new directory?

cd

rm

ls

mkdir

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What option should be used with 'mkdir' to create parent directories if they do not exist?

-r

-p

-d

-f

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command is used to remove a directory and its contents?

delete

rm -r

rmdir

rm

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the '-r' option in the 'rm' command do?

Renames files

Removes files only

Removes directories only

Recursively removes directories and files

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What command can be used to create an empty file?

echo

touch

cat

mkdir

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you view the contents of a file?

echo

ls

cat

touch

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command is used to write 'Hello World' into a file?

echo 'Hello World' > file.txt

touch file.txt

ls > file.txt

cat file.txt