0

I'm trying to delete a file Android will not let me delete it. Trying to use Termux, I can't seem to find the file. I used termux-setup-storage, and per the instructions entered:

cd /storage/sdcard0/FilesAndFolders

And get

bash: cd: /storage/sdcard0/FilesAndFolders: No such file or directory

I'm working with Android 11, and I am a real novice at this. I can't figure out what file path they want. Suggestions?

Even though I'm using:

rm -rf [directory name]

it still comes back saying the Directory is not empty. No command I try deletes this file. The file name at the end of the string has a black diamond with a question mark on it.

I tried SD Maid to no avail, Termux didn't work. I'm considering a factory reset as my only option. The file is a .mp4. I tried *.MP4, but no luck. I've tried deleting the folder and the file in every way I could find. I traced the file from the tree, sometimes it tells me the file doesn't exist when I can see it in the tree.

Is there any way to delete this file?

5
  • 1
    Try cd storage followed by ls to show you the contents. Probably your folder is in shared ; do cd shared and ls again to see if you can find the folder. //With a normal file explorer can you tell the path where is it stored?
    – beeshyams
    Commented Aug 13, 2023 at 14:18
  • 1
    Looks like you look at your phone via USB/MTP. The paths you can see there are virtual, they do not exist in file-system.
    – Robert
    Commented Aug 13, 2023 at 14:26
  • Maybe there is a nomedia file in that folder. Try deleting it using file explorer and then try to delete the folder rm - rf
    – beeshyams
    Commented Aug 13, 2023 at 19:46
  • See this android.stackexchange.com/a/205247/131553
    – beeshyams
    Commented Aug 13, 2023 at 19:49
  • "The file name at the end of the string has a black diamond with a question mark on it." seems to indicate that the file/SD card is corrupted. Perhaps the following Q&A might help: How to delete a corrupted file on SD Card
    – Andrew T.
    Commented Aug 14, 2023 at 14:05

3 Answers 3

0

I think the path is incorrect.

  • Try one folder at a time from the top and see when it fails.
  • Or install a file explorer app to look at what's there. I use X-plore.

I am not associated with it.

-1

Sorry for the mistake, I think I am wrong on what I wrote !!! I double checked to make sure that I got the right answer and solution for this, so here it is :

  1. Double-check the file path: Use the ls command in Termux to verify the path to the directory containing the file.
  2. Try using absolute paths: Instead of relative paths, use absolute paths like /sdcard/.
  3. Consider using wildcards: If you're unsure of the exact file name, use wildcards like *.mp4.
  4. Check file permissions: Use the ls -l command to see the file permissions. If it's read-only, use chmod to change them. If these don't work, you might need to explore more advanced methods like using a root explorer or a factory reset, or uninstalling and reinstalling the app might help. However, I'd recommend trying the above suggestions first.

Let me know if you have any other questions or if you need further assistance.

  • hopefully nobody is mad or upset about the previous answer :(
2
  • Hi. Could you mention the source for this? Also, have you tried it by yourself in the same situation as the OP?
    – Andrew T.
    Commented Nov 23 at 11:50
  • Yes, I've used Google Gemini, I took a screenshot of the problem and give it to Gemini, and it gave me the solution step-by-step without doing any mistake. I use the solution on my older android device who has this problem, I've used the first step-by-step of what Google Gemini said, but didn't work so he told me to uninstall and reinstall, and it worked perfectly. Hopefully somebody does get the problem fixed. Commented Nov 24 at 15:08
-2

i know what's the problem out there ! the problem is that you are in the folder that you are using to start a project on anything like python, javascript or npm, and it won't delete itself because you are in the folder ! if you are still in the folder, do exit the folder by doing this :

cd

and after that, you have to use this command :

rm -rf [Directory name]

the directory name is the name of the folder you are using for example cloning a github project which you could find the folder's name by using this command :

ls

and after that it will show you the folder's in the root that are present, and now you will do this command :

rm -rf github-boost

and you are done ! if it is asking for deleting files, do type the command yes !

Happy to help you Chief !!!

  • MikePinku <3
2
  • 2
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 27 at 16:12
  • 2
    Recommendation to OP: Do not follow these instructions until they have been clarified! I think @Alexander Lewis means cd .. as his first line of instructions, but that is not completely certain. It is dangerous to run rm -rf without confirming your location and target. Commented Oct 27 at 18:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .