freeCodeCamp/guide/english/bash/bash-rm/index.md

34 lines
767 B
Markdown
Raw Normal View History

---
title: Bash rm
---
## Bash command: rm
### Usage
**Delete a File**
```bash
rm <file name or file path>
```
**Delete a Directory**
```bash
rm -R <folder name or folder path>
```
There are few commonly used arguments:
- `-r` , means to recursively delete all the folders inside a directory.
2018-11-17 16:38:59 +00:00
- `-f` , means to forcefully delete any folder or file.
2018-11-03 04:15:39 +00:00
- `-i` , will ask before deleting the file.
- `-v` , will explain what was deleted.
### Warning
2018-11-03 04:15:39 +00:00
This command is capable of deleting many files at once with ease. This can be beneficial, but also dangerous. Use at your own risk.
### More Information:
* [Wikipedia](https://en.wikipedia.org/wiki/Rm_(Unix))
2018-11-17 16:38:59 +00:00
* [Man pages](http://man7.org/linux/man-pages/man1/rm.1.html)
* [Linux](https://linux.die.net/man/1/rm)