218k views
3 votes
Which option of rm command is used to remove a directory with all its subdirectories?

1) -b
2) -o
3) -p
4) -r

1 Answer

5 votes

Final answer:

The rm command's -r option is used to recursively remove a directory and all of its contents.

Step-by-step explanation:

The rm command in Unix and Linux is used to remove files or directories from the file system. To remove a directory along with all of its subdirectories and files, you would use the -r option, which stands for 'recursive'. Therefore, the correct answer to the question 'Which option of rm command is used to remove a directory with all its subdirectories?' is option 4) -r.

User Kjetilh
by
7.4k points