[Q] ls does not sort - Android Q&A, Help & Troubleshooting

When I start the ADB shell from the Windows command line, and type the command "ls", the list of files I get is not sorted by name. Also, if I enter "ls -r" which should reverse sort, I get the error message "no such file". If I type "busybox ls -l", I get the expected sorted list. Also, other commands like "busybox ls -la" work.
My Phone is a Samsung Captivate i897, rooted from Gingerbread with Corn Kernel v7.06 with Superuser and BusyBox installed.
How can I get the Busybox version of the shell commands to run without having to type "busybox" all the time?

The same problem
How to force sort in ls result ?

Related

adb mount remount problem

hello x10 buddys
srry for my noob question, but i have a problem...
when i go to run - cmd
adb shell
$ su
#
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
i am able to do this.
No i wanna install a theme with the file ****.cmd
I start the cmd file and i will get this error
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mount: Operation not permitted
Why i get this error?
i am not adb shell # at this moment?
You'll only be able to remount while you've root permissions...
If you do SU before doing the .cmd then you should be fine...
(You might also have problems with file permissions, in which case you'll need to run chmod 755 on some directory after remounting. If you've this problem, let us know. Maybe post the .cmd?)
Sent from my X10i using XDA App
i thougt that was the problem ty
but how i get SU before run the cmd file?
when i do adb shell in the directory of the theme
after that i cant run the cmd files or i did something wrong.
Spend the hole night on it ^^
the cmd file will be alright, its from the New theme here
Have u tried
Adb shell su
Then allow it with superuser?
I'm not sure if it will work as I haven't tested it...
Hope it helps
in my Su on the phone
Unkonwn
/system/bin/sh als root (uid: 0)
i wanna run ***.cmd when i am in cmd with su#
wen i start the **cmd i wil not have su#
i need to do....
adb shell
$ su
#
and then put a command to run ***.cmd file of the theme
when the **.cmd file in c:\desktop\newfolder\***.cmd
which command i need to write when i in adb shell # to run the cmd file??
If I don't remember wrong, I had to do this chmod 4755 /system/bin/su to get the "#" prompt (su) as default in Better Terminal.
Perhaps it will help you too ? (allowing the scripts to run as superuser)
Have you tried doing everything with adb shell? Ie
Adb shell su
Hit enter
Adb shell mount blah blah blah
Hit enter
Adb shell run the cmd
I read somewhere u should only chmod as a last resort and if u know what you're doing. For the most part i have no idea what's going on (i feel like Gary busey) so i haven't tried the chmod.
I would have posted the actual script but its a pita to do from my phone
he said run:not found ^^
How about at the beginning before adb shell su move to the directory its in.
Eg.
cd C:\the directory the cmd is saved
hphhaze said:
he said run:not found ^^
Click to expand...
Click to collapse
Adb shell run the cmd does NOT mean you should type in Adb shell run <some command>.
It means you should type in Adb shell <some command> where <some command> can be for example su, cp, dd or something else (unix commands).
tread can closed. I dont get it...
You're giving up that quick? :-(
Come on!!!!
Solution A:
1. Go here and download X10Root1.0.8.apk.
2. Install the apk to your phone.
3. Run the app and use it to "unsecure sh".
4. Run your CMD script.
5. Run the app again to "secure sh".
6. If you skipped #5 (secure), go back and do #5.
Solution B (alternative):
1. Download the Standalone Toggle Secure Shell script.
2. Extract and run it (it's a CMD script).
3. Select "Unsecure" and follow the directions (requires some typing or copy/pasting).
4. Run your CMD script.
5. Run the toggle script again to select "Secure".
6. Don't skip #5 (secure).

[Q] All adb commands saying permission denied

Trying to install Clockwork recovery mod on my LG Optimus V and I am running into a few problems. The version of ROM Manager that I got from the market does not list my phone as a model to choose from when the Confirm your phone window appears. So, to get around this, I decided to try and install another recovery (such as Amon's) using an adb shell. Anytime I try to type a command while in the adb shell it returns the command and says "permission denied" next to it. The $ is there, my phone is rooted, the SD card is unmounted and USB Debugging ot turned on.
I can view my phone from adb devices and even look at the log of its activity with adb logcat.
The first command I type in is "adb shell mount -o rw,remount /dev/block/mtdblock3 /system". After I hit enter, it says mountperation not permitted.
I also can't boot into recovery mode at the moment because I had to choose a phone that is different from mine when I tried to flash Clockwork Recovery mod.
I'd greatly appreciate any help, I'll get some sleep and check back in a few hours.
ironpirat3 said:
The $ is there, my phone is rooted
Click to expand...
Click to collapse
The $ is normal user and not root (#).
Code:
> adb shell
$ su
# mount -o rw,remount /dev/block/mtdblock3 /system
Turns out I wasn't looking at my phone and allowing the su command through Superuser (feel really dumb now). Still, whenever I try to run a command starting with adb shell from the command prompt it says Operation not permitted.
Code:
>adb shell mount -o rw,remount /dev/block/mtdblock3 /system
mount: Operation not permitted
On a side note, how do I get out of my phone and back into command prompt after using the adb shell command?
ironpirat3 said:
Turns out I wasn't looking at my phone and allowing the su command through Superuser (feel really dumb now). Still, whenever I try to run a command starting with adb shell from the command prompt it says Operation not permitted.
Click to expand...
Click to collapse
Code:
>adb shell mount -o rw,remount /dev/block/mtdblock3 /system
mount: Operation not permitted
No. You run adb shell only, and then su, and then remount from the phone shell, NOT via adb. Clearly written in the example above.
To exit a shell, type exit.

[Q] adb shell prompt

Hey everyone I got a very technical question
I am trying to set a custom prompt for the shell on an android device running bourne shell (sh), I have suceeded in setting it for a login shell (sh -l) but I would like to make this default for non login like adb or ssh through connectbot @localhost. Normally on linux I could do this by editing /etc/profile but for some reason on my android sh does not read /etc/profile unless it is a login shell. I tried moving the sh binary and replacing the sh binary in /system/bin with a shell script that executes sh -l but I loose superuser access ( shell reports su command not found) so I moved sh back to /system/bin/sh. Does anyone have any Idea which file is read in by sh at launch?

LG G2 mini D620r V10e "/sdcard/: no such file or directory"

Hello,
I've followed many discussion about bootloader unlock and trying to do it on my phone, has happened a thing that's following I dont understand.
Terminal in Rooted device:
- if I'm normal user i can type and see the list of command "ls /sdcard/"
- if I type "su -c ls /sdcard/" or "su" + "ls /sdcard/" I always receive the error "no such file or directory"
For getting the list as root I've to type "ls /storage/emulated/0/"
Does anybody know why?
Would be dangerous to type "dd" for overwriting aboot using /storage/emulated/0/ path instead of /sdcard/ path?
Thanks

Editing Hosts File on Rooted Android 11 Google Pixel 3

I'm trying to edit the hosts file in /system/etc/hosts on Android and I rooted the device via Magisk. When I utilize adb push through my Linux machine it can't do it because the system is read only. After seeing this I looked up how to mount it as rw and back but disabling dm-verity didn't work, neither did adb remount (It claimed there was no remount command) and after dropping into a shell on both a terminal emulator on the app and through adb itself it can't remount the filesystem as rw no matter what I do. Ultimately it comes down to three errors on my machine: "adb root" returns: "adbd cannot run as root in production builds", under "su" in the shell a simple "mount -o rw,remount /" returns: "'/dev/block/dm-0' is read-only", "disable-verity" returns: "verity cannot be disabled/enabled - USER build", and "adb root" returns: "adbd cannot run as root in production builds" to which I can find no solutions online. I have also tried going into a file explorer and manually editing the files that way but I still get an error that it's read only. Is there anything at all I can do?
T3ntr0 said:
I'm trying to edit the hosts file in /system/etc/hosts on Android and I rooted the device via Magisk. When I utilize adb push through my Linux machine it can't do it because the system is read only. After seeing this I looked up how to mount it as rw and back but disabling dm-verity didn't work, neither did adb remount (It claimed there was no remount command) and after dropping into a shell on both a terminal emulator on the app and through adb itself it can't remount the filesystem as rw no matter what I do. Ultimately it comes down to three errors on my machine: "adb root" returns: "adbd cannot run as root in production builds", under "su" in the shell a simple "mount -o rw,remount /" returns: "'/dev/block/dm-0' is read-only", "disable-verity" returns: "verity cannot be disabled/enabled - USER build", and "adb root" returns: "adbd cannot run as root in production builds" to which I can find no solutions online. I have also tried going into a file explorer and manually editing the files that way but I still get an error that it's read only. Is there anything at all I can do?
Click to expand...
Click to collapse
Search forum for superrepack tool or SystemRW script. Good luck!
Worked on Android 11 with lineageos: https://www.howtogeek.com/140576/how-to-edit-the-hosts-file-on-android-and-block-web-sites/

Categories

Resources