ADBFiles & StorageDestructive
adb shell rm -rf <path>
Delete files or directory recursively
Destructive Operation WarningPermanently deletes files with no recycle bin or recovery option.
What It Does
Deletes a file or directory tree from the Android storage volume.
Command Syntax
Terminal
$
adb shell rm [-r] [-f] <path>Parameters & Placeholders Breakdown
This command syntax includes specific placeholder tokens. Below is an explanation of what each word represents and concrete real-world values to replace it with:
[-r] R ParameterReplace this placeholder with your specific r value.
Real-world value:your--r
Command syntax:
adb shell rm your--r [-f] <path>[-f] F ParameterReplace this placeholder with your specific f value.
Real-world value:your--f
Command syntax:
adb shell rm [-r] your--f <path><path>Target File or Directory PathA file or folder path on the Android device or host machine.
Real-world value:/sdcard/screenshot.png
Command syntax:
adb shell screencap -p /sdcard/screenshot.pngUsage Examples
$
adb shell rm /sdcard/test.txt$
adb shell rm -rf /data/local/tmp/test_dirOptions & Flags
| Flag / Parameter | Description |
|---|---|
| -r | Recursive deletion for directories. |
| -f | Force removal without prompting. |
Prerequisites & Requirements
- Write permissions on parent directory
Related Commands
Found an error or missing flag for
adb shell rm -rf <path>?Submit a correction or request additional examples on GitHub.
Having issue? Contact @mkr_infinity
Direct technical assistance & ROM flashing troubleshooting by Mohammad Kaif Raja.