Use the adb command to delete files and folders in the Android system data directory

tags: android  shell

Using commands to delete the folders in the data directory is different from deleting general files.

The files in the data directory require 777 permissions, so the required commands are different

data directory:

C:\Users\aw>adb shell
root@android:/ # su
su
root@android:/ # cd data/data
cd data/data
root@android:/data/data # cd /data/inspur
cd /data/inspur
root@android:/data/inspur # ls
ls
LEDCONF.ini
ipconfig.xml
ipmap.xml
root@android:/data/inspur # chmod 777 ipconfig.xml
chmod 777 ipconfig.xml
root@android:/data/inspur # rmdir ipconfig.xml
rmdir ipconfig.xml
root@android:/data/inspur #

 The ipconfig.xml folder is deleted here. It was originally a file, but the folder format was generated by mistake.
1,adb shell
2, su
3, cd /data/inspur to enter the directory
4, ls View files in the directory
5, chmod 777  ipconfig.xml get operation permissions
6, Rmdir ipconfig.xml delete folder
 If you delete the file rm file
 Delete the folder and its contents rm -r

General catalog:

C:\Users\aw>adb shell
root@android:/ # su
su
root@android:/ # cd /mnt/sdcard/
cd /mnt/sdcard/
root@android:/mnt/sdcard # ls
ls
Alarms
Android
DCIM
Download
LOST.DIR
Movies
Music
Notifications
Pictures
Podcasts
Ringtones
backup
bak
crash
icbcbox
log
updatefile
  ban
root@android:/mnt/sdcard # rm -r crash
rm -r crash
root@android:/mnt/sdcard #

 Delete the folder under the general directory
1,adb shell
2,su
3,cd /mnt/sdcard/
4,ls
5,rm -r crash delete folder and content
 Delete folder rmdir folder
 Delete file rm file

Intelligent Recommendation

Use the tree command to export the directory tree of windows folders/files

Use the tree command to export the directory tree of windows folders/files Tags (space separated): windows tips Use the tree command to export the directory tree of windows folders/files Example Start...

Linux command to delete folders and files

1. Delete the folder instance: Will delete the /var/log/httpd/access directory and all files and folders under it 2. Delete file usage examples: Will delete the file /var/log/httpd/access.log...

Ubuntu delete files and folders command

-r means downward recursive deletion -f means to force delete directly without any prompt Generally use rm -rf for folder deletion (recursive deletion is required for folder deletion) Generally use rm...

Delete files in the directory and delete empty folders

1. Delete all files in the directory 2. Delete the empty folder under the directory...

Android adb View App /data/data/ directory files

must be Android DebugSigned application can...

More Recommendation

.Nomedia delete files in the specified directory folders and files

In order to shield some of the files we create in the phone sd card .nomedia folder or file, the system does not scan the folder, it will not scan files contain .nomedia file folder.   Sometimes ...

Use git command on IDEA to delete files or folders on GitHub

problem This is the directory structure of a project on GitHub But maybe we don't need to upload .idea folder or ONE.iml or other files or folders to GitHub. However, we have uploaded the project to G...

Android system ADB command

** Android system ADB command ** 1 View Memory Information command: adb shell dumpsys meminfo Enter the command: Dumpsys Meminfo PID, such as 360 security guards installed, then the actual command sho...

CMD directory operation-del [delete ordinary files] and rd command [delete non-empty folders]

Delete many files: 1. Switch to the desired folder address via cd 2. Execute the following command:   Delete empty folders and non-empty folders: parameter: /s delete the specified directory and ...

Android copy and delete folders and files

In the development, the copy and delete operations of files and folders are also commonly used, and make a record below for backup...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top