Adb shell rm

This command is used to remove the specified directory

adb shell rm -f /path/to/directory

Forcefully remove without asking for confirmation. Won't throw any error if the file does not exist.

adb shell rm -f /mnt/sdcard/Download/test.apk

adb shell rm -i /path/to/directory

Interactively prompt for confirmation.

adb shell rm -i /mnt/sdcard/Download/test.apk

adb shell rm -rR /path/to/directory

Recursively remove directory contents.

adb shell rm -rR /mnt/sdcard/Download/test.apk

adb shell rm -v /path/to/directory

Verbose.

adb shell rm -v /mnt/sdcard/Download/test.apk

adb shell rm /path/to/directory

how to image


Frequently Asked Questions


What is adb shell rm command?

It is a command to remove a directory and its contents.

Will I get an error if I try to remove a file that does not exist?

If you use the adb shell rm command, you will get a prompt if you try to delete a non-existant file but in case you are forcefully deleting using the adb shell rm -f command, you won't be getting any prompts.

How to remove files without confirming for deletion everytime?

To remove files without confirming everytime, use the adb shell rm -f command.

rating-img
Rate this tool
NaN/5   0 votes