![]() System files and folders can be deleted more easily on a Linux system than on Windows or Mac. You should be careful when deleting folders and files with an “rm –rf” command, as you might lose important data or damage the operating system. However, if you type in “rm –rf” instead, you will not be prompted. When you execute an “rm –r” command, Linux Command Line will ask you for permission to delete any sub-folders and files that are write-protected. It can be used on its own and combined with other options. In Linux Command Line, “-r” stands for recursive. ![]() This is possible thanks to the “-r” option which replaces the “-d” from the previous command. The command above will delete all the specified folders, their sub-folders, and files in them. rm –r nameofthedirectory1 nameofthedirectory2 It will just stop, without giving you an error message. If it happens that the first folder you named isn’t empty, Command Line will not try to delete other folders. The catch here is, like with the previous one, they all have to be empty. The command presented above will delete multiple folders. rm –d nameofthedirectory1 nameofthedirectory2 This is the most basic command for removing/deleting folders. The command above will only let you delete a single, empty directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |