Visit Our UNIX and Linux User Community


Basic commands for android!!


 
Thread Tools Search this Thread
Operating Systems Linux Android Basic commands for android!!
# 8  
Old 08-30-2013
You might be limited to /bin/ed instead...

Good kuck...

For "printf" use "echo -e -n" instead, but I suspect you already know that... ;o)
This User Gave Thanks to wisecracker For This Post:
# 9  
Old 08-30-2013
Thanks Wisecracker!!

echo -e -n "\033[2J" cleared the screen but it didn't take the cursor to top left.

echo -e -n "\x1B[2J\x1B[1;1f" did not work for me.

/bin/ed - I treid earlier also but it did not work.
# 10  
Old 08-30-2013
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.
Code:
cat >new_file_name

Edit: When you are finished typing your text press <ctrl>+d or <ctrl>+c to stop.

Last edited by cero; 08-30-2013 at 09:02 AM..
# 11  
Old 08-30-2013
Try:-
Code:
echo -e -n "\x1B[2J\x1B[1;1H"

Maybe you terminal does not recognise "f"...

As for the editor I am at a loss except write your code on another *NIX like machine and use your email to obtain it is an attachment to an email...
# 12  
Old 08-30-2013
Quote:
Originally Posted by shekhar_4_u
I am not able to even use 'vi'
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.

Regards,
Alister
# 13  
Old 08-30-2013
One of the first things many do with a rooted phone is install sshd so they can login with any ssh client and get a real shell (edited by neo)
# 14  
Old 09-02-2013
cat > file_name worked for me. I am surprised why I did not try it earlier. Thanks Cero. Smilie

saved echo -e -n "\033[2J" in my /system/bin file as 'clear'. Its working now but same problem remains. Cursor doesn't go to top left of the screen.

Wisecracker : echo -e -n "\x1B[2J\x1B[1;1H" did not work either.Smilie

Previous Thread | Next Thread
Test Your Knowledge in Computers #670
Difficulty: Medium
Fourteen channels are designated in the 2.4 GHz range, spaced 5 MHz apart from each other except for a 12 MHz space before channel 14.
True or False?

10 More Discussions You Might Find Interesting

1. Android

Basic Android platform information.

I am thinking of developing an app' for Android mobile devices... Two questions here:- 1) Does anyone _develop_ for the Android _mobile_ platform? If so do you use OSX 10.7.5 or greater as your _development_platform_? 2) I know ********* is gonna say that the Android terminal/shell is... (13 Replies)
Discussion started by: wisecracker
13 Replies

2. UNIX for Dummies Questions & Answers

Noob scripting question with android ADB commands

Hi I'm pretty new to scripting and I've been googling around looking for an answer but have yet to come up with a proper solution. I work with multiple android devices at a time and I'm looking to simplify my life with a script. Basically I'm looking for a script that takes the device ID's and then... (2 Replies)
Discussion started by: Onyoursix
2 Replies

3. Android

Example Linux Commands on Android

In case you are interested, here is a partial list of linux-like commands on Android OS: /sbin adbd devmgr recovery dfta init dfta.sh fat.format redbend_ua /system/bin (partial list) sh date netstat mount umount (0 Replies)
Discussion started by: Neo
0 Replies

4. Solaris

Required list of all basic commands for a beginners

I want the commands list to view only files, and only directories and all the basic commands for a beginner of solaris (1 Reply)
Discussion started by: omsingh2k5
1 Replies

5. Red Hat

Segmentation fault on basic linux commands

Hello out there!!! I have a Red Hat Entreprise Linux 4 server and I am encountering this error # grep Segmentation Fault I know it is not the right use of grep command, but I did that just for testing purpose,then I did # which grep /bin/grep # ls -l /bin/grep -rwxr-xr-x 1 root... (4 Replies)
Discussion started by: inhaki
4 Replies

6. UNIX for Dummies Questions & Answers

Vi editor basic commands

I would be thankful if anyone could show me commands to do the following tasks in vi:1) How can I undo or redo my last action in vi editor. 2) How can I copy only a word or a portion of line (not the whole line) in vi, like we can select text and press ctrl+c in notepad to copy any text. 3)... (4 Replies)
Discussion started by: nervous
4 Replies

7. Windows & DOS: Issues & Discussions

Basic Unix Commands for cygwin

Hi. I'm New user for this Forum.Presently i'm working with Cygwin I want to know the basic commands that will be used for Cygwin. Can anyone guide me on this regards Thanks & Regards Sanjay (0 Replies)
Discussion started by: sanjay.karthik
0 Replies

8. Shell Programming and Scripting

Need help in sftp basic commands

I'm trying to make use of some common generic functions already present in the scripts loaded in the environment. A variable VAR1 is declared and used in the generic functions. Its value is also set in the generic function. Now I need to use that generic function for PURGING of some old files... (2 Replies)
Discussion started by: livetaurean19
2 Replies

9. UNIX for Dummies Questions & Answers

basic commands documentation

I'm training a newbie on unix. He's in another site and I can't share my unix books with him - is there any documentation on basic unix commands he can download? (1 Reply)
Discussion started by: kdgorton
1 Replies

10. UNIX for Dummies Questions & Answers

Unix basic commands

I need a sheet with the basic unix commands , and commands for VI editor. Does anyone know where i can get them. (3 Replies)
Discussion started by: Peter Spellman
3 Replies

Featured Tech Videos