Daily Buzz & Bicycle World: How to delete a directory or a file?

Hi everyone,

I’ve finished these two projects and I was wondering how I can delete a file or directory. Eg. I created a directory at a wrong place, also I made a typo in the file name.
What is the shell command for that?

Thanks

Hi,

To delete a directory the command is rm -r <directoryName> .

Be careful with this command as the -r stands for recursive and will delete everything in that directory (often with no confirmation message).

To delete a file the command is rm <fileName>.

For more info read man rm manual pages for rm.

3 Likes

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.