Changes

Jump to: navigation, search

Tutorial2: Unix / Linux File Management

6 bytes added, 20:40, 6 January 2021
Part 3: Removing Directories
# Confirm that you are located in your home directory.<br><br>The '''rmdir''' command is used to remove <u>empty</u> directories.<br><br>
# Issue the following Linux command to remove the empty directory called '''uli101/tutorials''': <span style="color:blue;font-weight:bold;font-family:courier;">rmdir uli101xx/tutorials</span><br><br>
# Issue the following Linux command to remove the empty directory called '''uli101''': <span style="color:blue;font-weight:bold;font-family:courier;">rmdir uli101xx</span><br><br>NOTE: You should get an '''error message''', since the '''uli101''' directory is '''NOT''' empty.<br><br>To remove non-empty directories, you can use the '''rm -r''' command.<br>The '''-r''' option stands for recursive, which can travel down the directory paths and their contents.<br><br>
# Issue the following Linux command to remove the '''uli101''' directory and its contents: <span style="color:blue;font-weight:bold;font-family:courier;">rm -r /home/your-seneca-id/uli101xx</span><br><br>
# Issue the '''tree''' command to confirm that the uli101 directory (contained in your home directory) and its contents have been removed.<br><br>'''NOTE:''' To <u>safely</u> remove non-empty directories, you can add the '''-i''' option which will prompt the user if they wish to remove contents as it your travel recursively down a directory to remove directories and their contents.<br><br>
13,420
edits

Navigation menu