I have a n android phone and just rooted it. I access it using 'terminal Emulator'. I performed many basic linux-like commands in the terminal like rm,ls,df,reboot etc and they are working fine. But many of them are not like man <something>, clear,du etc.
Can any of you please help to tell me alternatives for 'clear' and 'man' for android?
I have just installed CygWin for the first time on my old Windwoes box and that didn't have clear either, so I quickly hacked this simple shell script and saved it in /usr/bin as clear...
#!/bin/bash --posix
# 'clear' command.
for n in {0..127}
do
printf "\n"
done
printf "\x1B[1;1f"
Hopefully it will work for you with your version of shell. If not just experiment...
Don't forget to set the permissions as 755 or something similar and just launch it as the clear command...
To create a file you may abuse cat but it does not offer any editor functionality (cursormovment,...). Without a file as argument cat takes stdin as source.
Redirect its output to the new file.
cat >new_file_name
Edit: When you are finished typing your text press <ctrl>+d or <ctrl>+c to stop.
I believe Busybox is available for Android. If so, that's probably an easy way to fill in most missing utilities.
Regards,
Alister
---------- Post updated at 10:47 AM ---------- Previous update was at 10:40 AM ----------
Regarding clear , that's usually a hardlink to, or a script which calls, tput . In the Linux world, those tools are part of ncurses . I would be surprised if it isn't also available for Android, since a lot of tools depend on it.
You do not have a real terminal... (edited by neo). There's entire categories of things it cannot or will not do. Most people, once they root a machine, install sshd so they can login with a real terminal and do real things.