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

34 lines
687 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.
- `-f` , means to forcefully delete anything folder or file.
- `-rf` , means that both arguments will be used together.
### Warning
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))
* [Linux](https://linux.die.net/man/1/rm)