| 
									
										
										
										
											2018-10-15 22:32:55 +05:30
										 |  |  | --- | 
					
						
							|  |  |  | title: Bash rm | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Bash command: rm
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-27 16:25:36 +01: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 22:32:55 +05:30
										 |  |  | 
 | 
					
						
							|  |  |  | There are few commonly used arguments: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-27 04:21:02 +01:00
										 |  |  | - `-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. | 
					
						
							| 
									
										
										
										
											2018-10-15 22:32:55 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-28 21:33:37 -04:00
										 |  |  | ### 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 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-15 22:32:55 +05:30
										 |  |  | ### More Information:
 | 
					
						
							|  |  |  | * [Wikipedia](https://en.wikipedia.org/wiki/Rm_(Unix)) | 
					
						
							| 
									
										
										
										
											2018-10-27 04:21:02 +01:00
										 |  |  | * [Linux](https://linux.die.net/man/1/rm) |