A
A
AndreyFr2017-07-26 16:12:01
Android
AndreyFr, 2017-07-26 16:12:01

Display a list of directories on a wretched shell from Android?

An old android phone, somewhere around the second version ...
A lot of commands are not available, including test, ls with the -d switch, find and so on.
I'm trying to display directories like this:

$ cd /sdcard/ && for d in .*/ */ ; do echo "$d" ; done
../
./
.BD_SAPI_CACHE/
.adobe-digital-editions/
.android_secure/
.bookmark_thumb1/
.data/
.estrongs/
Android/
BubbleUPnP/
DCIM/
Documents/
Download/
LOST.DIR/
My Documents/
backups/
baidu/
bugreports/
com.bluevpn/
media/
tmp/
zzz/

The first question is how to remove this:
../
./
Next, I try to display dirs in an empty folder:
$ cd /sdcard/zzz/ && for d in .*/ */ ; do echo "$d" ; done
../
./
*/

Again, how to get rid of these outputs:
../, ./, */
If the folder is empty - do not output anything, if the folder is not empty - do not output: ../, ./

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question