How to delete folders in sdcard of file explorer?

后端 未结 6 956
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 06:53

I created several folders in the sdcard (Eclipse) by running an Android application in the emulator. Now I want to delete the folders which I have created on the sdcard.

相关标签:
6条回答
  • 2021-02-02 07:12

    Using adb command you can delete folders.

    click Run - > CMD-> type adb shell --> cd sdcard -> rmdir {dirname}

    Note : Make sure your dir should be empty.

    For non-empty directory use.

    click Run - > CMD-> type adb shell --> cd sdcard -> rm -r {dirname}

    0 讨论(0)
  • 2021-02-02 07:15

    We can do it in a single command line as under:

    adb shell rm -r sdcard/<dirname>
    
    0 讨论(0)
  • 2021-02-02 07:16
    1. remount the sdcard with read and write permission: adb shell mount -o remount,rw /

    2. Go to adb shell: adb shell

    3. Delete file you want: rm -r /sdcard/file_name

    It will work most better.

    0 讨论(0)
  • 2021-02-02 07:21

    Using adb shell with rm command you can delete(nonempty as well as empty) folders.

    click Run -- > CMD--> type adb shell --> cd sdcard --> rm -r {dirname}
    
    0 讨论(0)
  • 2021-02-02 07:33

    If you want to delete everything in your android file system, you need to get its storage name from adb!

    # adb shell echo $EXTERNAL_STORAGE
    

    It will give you the path where everything is stored!It will print the storage name in command line, for few devices it is /sdcard and for few, it is /storage/emulated/legacy etc Now you want to delete everything in that, you need

    # adb shell rm -r /sdcard/
    

    that /sdcard/ is not same for all devices, it could be /storage/emulated/legacy/ for some devices!

    warning-: It will delete every folder in your file manager except "android" folder

    now if you want to delete a particular folder in that file manager

    # adb shell rm -r /sdcard/FolderName
    
    0 讨论(0)
  • 2021-02-02 07:36

    Well, answer from Brijesh Thakur is really helpful.

    I just tried this and it worked fine for me to some extent. I would like to mention that if your directory contains any files then the rmdir command will not work. You will have to use rm -r command for that.

    To make it more easy for beginners I am explaining the process as follows.

    1. First you need to locate your adb folder, mine was at D:\Android SDK\platform-tools>

    2. Now execute adb shell in a command prompt as:

      D:\Android SDK\platform-tools>adb shell
      
    3. A hash (#) symbol or dollar sign ($) will appear, then enter the following command:

      # cd sdcard
      
    4. Now you are in the sdcard of the device. If your folder is a sub folder then further locate its parent folder using the cd command. Finally, use the rm -r command to remove the folder recursively as follows. This will delete all files and directories in the folder.

      # rm -r FolderName
      

    Please note that if you want to remove a single file you can use the rm command only and then the file name (with extension probably). And you can also use rmdir command if the directory you trying to delete is empty.

    0 讨论(0)
提交回复
热议问题