2018-10-15 17:02:55 +00:00
---
title: Bash rm
---
## Bash command: rm
2018-10-27 15:25:36 +00:00
### Usage
**Delete a File**
```bash
rm < file name or file path >
```
**Delete a Directory**
```bash
rm -R < folder name or folder path >
```
2018-10-15 17:02:55 +00:00
2018-12-21 01:59:33 +00:00
You will be prompted with ** 'rm: remove regular file ‘ hello’ ?'** and will need to respond ** 'y'** before the file can be deleted. Use this command with caution because 'rm' is a permanent action.
2018-10-15 17:02:55 +00:00
There are few commonly used arguments:
2018-10-27 03:21:02 +00:00
- `-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.
2018-10-15 17:02:55 +00:00
2018-10-29 01:33:37 +00:00
### 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.
2018-11-17 17:48:26 +00:00
To remove a nonempty folder for example, type:
`rm -rf folder`
2018-10-15 17:02:55 +00:00
### 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 )