3 ms·
Can you explain? I feel like it removes / but not sure why.
by SnowHill9902 4y ago
Can you explain? I feel like it removes / but not sure why.
- switch007 4y agoThe error is the space before the asterisk. The original intention was to delete the contents of the folder /path/to/delete/. Instead, the asterisk enumerates files in the current directory and they get deleted
- KarlKode 4y agoBesides recursively deleting /path/to/delete/ the command also deletes all (non hidden) content of the current directory (note the * at the end of the line). I assume the correct command would be /path/to/delete/*.
- Tesl 4y agoIt removes everything in the current directory
- pwg 4y agorm -rf /path/to/delete/ * Note the space between the last / and the * This will recursively remove the directory /path/to/delete and remove every file/directory that matches * in the current directory where 'rm' is being run. When what was most likely meant was: rm -rf /path/to/delete/* Note the lack of a space between the last / and . This will remove all files that match that reside in the /path/to/delete/ directory.