[Q] How to use Terminal Emulator just for practice? - General Questions and Answers

Hi,
I want to practice bash commands on my phone.
I am trying to learn Linux.
I got Terminal Emulator for Android by Jack Palevich from the Play Store to load on my phone and get me to the command prompt, so I can run some commands in there.
But I don't want to mess up my phone as I practice.
Are there some settings I can do to config it so it doesn't actually run anything for real but just acts as a practice terminal?
Or is there a better app / method just to practice bash commands?
I know how to practice on my PC ( Google coding ground bash!) but I am looking for Android methods now.
Thanks for any help!

Well android usually doesn't have bash(some custom rom do have bash).
Android have a built-in shell with a few basic commands. That's why busybox used because it has more basic command.
I would suggest trying commands on pc since it's easier and command's have man pages and help and usage built into the commands.
If you try it on your android you can't really make too much damage(maybe delete data on sd-card) unless you use root(# marks root before your commands).
Android uses standard unix tools so most commands will work like on a linux pc.(If it doesn't you can always use busybox).

Related

Linux Working on Android

(I'm reposting this under a different title so web searches will bring it up)
I can get Ubuntu 11.04, 11.10 & Debian 6 to mount repeatedly in all sorts of ui updatable configurations using this information:
http://www.nerd65536.com/2011/07/ins...version-2.html
It's a friggin Christmas Miracle! Can't tell you how much time I've wasted working this out, and it all boils down to the sh and run scripts.
So, without further ado, here goes.
!!Make sure you're rooted!!
!!The quotes just tell you what to type. Don't type them!!
1.
Download one of the three builds on the website listed above (or build your own, it should work fine). Extract it from tar.bz2, they should all extract to a linux file, this includes the necessary scripts. Put it on the sd-card on your phone.
2.
Download the new scripts that (Nerd) listed found here: http://ohm.nerd65536.com/android-lin...latest.tar.bz2
And extract them. You'll have another file that says linux. Open it, take the three files inside (install.sh, root-scripts & scripts) and paste them in the linux folder you moved to your sd-card. They will overwrite the ones currently there. These scripts work for sgs4g, the originals did not.
3.
Install the latest BusyBox in both xbin and .bin if it's not already installed (must be rooted), Latest is 1.19.3. Make sure Outside Sources and USB debugging are both enabled in your settings menu. Open your Superuser App and update binaries.
4.
Download a terminal client, like Better Terminal Emulator or Android Terminal Emulator. I use the first. The terminal needs to run the commands as root, especially the linux vnc command as it didn't want to work for me no matter if I started by typing su. Better Terminal Emulator has a check box to always start in root.
5.
Open up your terminal emulator and type su if you are not rooted there. Then change directory to the linux file on the sd-card. run the sh file there.
Like this:
"su"
"cd /sdcard/linux"
"sh install.sh"
If it works, the resulting dialog in terminal won't throw up any problems.
6.
Get back to / on sd by typing in terminal:
"cd /"
You should then have a: / # prompt, which means you are still rooted.
Enter:
"linux"
Which should result in a: [email protected]:/#
This means Linux is running. Congratulations. It should continue to run unless you shut down your phone.
7.
Download a VNC client, like Android VNC Viewer (free) or Remote VNC Pro, which I use. Add a new entry in it, with the following settings:
Host: localhost
Port: 5901
Password: cheesecake
Color: 24-bit
Name: Linux
When that's done save if you can or back out if you can't, and go back to your terminal emulator.
8.
It should still say: [email protected]:/#
If it doesn't, fine, if it does, just go back to root prompt by typing:
"exit"
Which should get you: / #. Then type:
"linux vnc"
Which should run itself and mount the chroot environment. It should tell you your new 'X' desktop is localhost:1, and have a: / # prompt again.
It might also ask you for a password, if so then put whatever password you'll remember in that's longer than 6 characters and verify it. This only happens once.
9.
Go back to your VNC client and if you entered a password in step 8. then edit your listing to your password instead of cheesecake, if not then don't.
Click on the Linux link and BAM! (shameless Emerilism), you're at your Linux desktop which should be running a iceWM desktop interface, which is fast. The LXDE desktop is nicer and if you want that then go into you're terminal and get into the linux shell by typing:
"linux"
And then switch to LXDE by typing:
"apt-get autoremove icewm- lxde+"
Which will run through the removal/ installation, and verify you want to download the <400mb files. Type:
"y"
And give it time to finish. When finished, just go back to your VNC client and hit Linux again, and you will have a nice looking functional desktop, with a cpu load graph on the bottom. I tried using Gnome desktop and Unity 2d, but both of these would install and not fully run with all options. They are heavier and slower, but cool non-the-less. Let me know if anyone has luck with these on Android.
Notes-
You only have to type "linux vnc" once in terminal to start linux every time you boot your phone. Otherwise, just open your VNC client and click on Linux to use it. Easy!
You will want to update and upgrade your linux after install, do so by typing in terminal:
"apt-get update"
"apt-get upgrade"
Also, you might run across a problem if you try to add-apt-repository, that's because that python command is not present. To use it, enable by typing:
"apt-get install python-software-properties"
Also of note, the downloadable linux builds are sized to about 2.15gig on your sd, which is big enough for most. There is a way to resize them which I tried but it gave me trouble in loading. I will try again and see if I can get it to work.
Here's the link from Dangermouse:
http://www.androidfanatic.com/commun...atid=9&id=1610
Thanks to Nerd65536 for the info, write-up and files. He fixed my problem.
You might want to put quote or code tags around all the commands to make them easier to see and read, but good guide! I'll try it out soon since I haven't gotten any linux build to run on my phone in a good while.
Thanks for the post!
I wrote the post noob-style to make it easy for beginners to follow, as I've had to search and test forever to find information that works.
Let me know if you have any problems, I'd be happy to assist. Don't expect you'll have any issues with your knowledge of the os. It works pretty well on the Android system, fun to use.
wasn't this posted ages ago?
No, it's a bleed over from a question post I made under Q&A a week or so ago. I threaded this because I had such a hard time finding a thread with working steps for the Galaxy S under google search. There's not that much new from this post http://www.nerd65536.com/2011/07/in...showComment=1323566336074#c553594301247543088 by Nerd65536 (which took me forever to find and was the only one that worked). Other than that, just a few of my own thoughts and hints on the process.
krylon360 said:
wasn't this posted ages ago?
Click to expand...
Click to collapse
meant to quote not thanks, but anyways, to answer.
There has been a few times this has been posted, but its been many months and this seems like the first the issues have been sorted.
Sent from my SGH-T959V using Tapatalk
Ok, a little more use of Linux builds on my phone and I'm starting to understand why it does or does not work.
Certain kernel builds seem to work well, others not at all. Most of the kernel's I've tried have been problematic, and trying to install the .sh file will fail.
When you install your new kernel (or on your existing one) you need to open your Superuser app which should be there if your phone is rooted. There is a button to update binaries, and they need to be updated. Some builds don't seem to let this work easily and give failure notifications.
Make sure Outside Sources is enabled and USB debugging is too, both are in the settings menu.
Use BusyBox installer to install in both the .bin and .xbin directories, this will not cause any conflicts (or hasn't yet . If this gives you an error, and it will if Superuser did, then either usb debugging has not been selected or the kernel is not playing nice.
Ok, so this kernel by RaverX3X will work for linux, I'm on it now:
http://forum.xda-developers.com/showthread.php?t=1305145
(Thanks for this)
Oh yeah, and Back|Track5 Linux is working too
Fixing the packet injection for the Broadcom now.
sconsylman said:
Oh yeah, and Back|Track5 Linux is working too
Fixing the packet injection for the Broadcom now.
Click to expand...
Click to collapse
. Keep us posted on that. Should be pretty handy.
Wait. why do we need LInux to run on our phone?
Can someone explain?
Android doesn't come with most of what this has:
http://www.backtrack-linux.org/
I know, but why do we need it?
Enlighten me
airfluip1 said:
Wait. why do we need LInux to run on our phone?
Can someone explain?
Click to expand...
Click to collapse
I've seen this comment on every single thread online regarding Linux on Android. It's a joke right?

Need Android Terminal Command Reference

Does anyone have a list or link to the android terminal command set? I found a few for Unix/Linux but some commands don't work and others I know work on Android aren't even listed. Who has a complete list of terminal commands for say the market app "Android Terminal Emmulator"
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
elfaure said:
Does anyone have a list or link to the android terminal command set? I found a few for Unix/Linux but some commands don't work and others I know work on Android aren't even listed. Who has a complete list of terminal commands for say the market app "Android Terminal Emmulator"
Click to expand...
Click to collapse
The terminal emulator only emulates a terminal. The commands available depend on the programs installed on your device.
You can use the busybox documentation as a guide for the common Unix commands implemented in busybox:
http://www.busybox.net/downloads/BusyBox.html
For some commands which have a more limited implementation in Android (look into /bin), e.g. chmod, run "busybox chmod" instead of "chmod" to get the more capable version.
But you can also install more programs, or advanced versions of the commands busybox provides.
_that
Thks. With as many emails as you entertain daily, I really appreciate you taking the time to always give a detailed and educating explanation with great links.
I like Jack's explanation on wiki for his market app "Android Terminal Emulator". He says you can:
echo $PATH
then
ls -al /PATH for each PATH in $PATH to list all the commands available on your device

Managing Android Device From Shell

Is there a way to put an Android phone on silent from shell. Or can I delete messages from shell without root? I'm looking for some commands for android terminal. you can write any command you know. I want to learn. Ty.

Is there any version of ADB rewritten in C++?

Yes, the question I'm asking is in the title. Context: I want to use certain adb commands (such as shell) to connect and get some status of the BlueStacks emulator. However, using the system command in C++ requires the platform tools to be put in the same directory as the C++ program, which is kinda large in size if I wanted to distribute it.
Don't know of any.

[Vulnerability] Bluestacks root access via adb

On GitHub: https://github.com/KDVB/BlueStacks-ADB-root-access​​Disclaimer​For informational purposes only. The author does not call for further actions. Created to warn users who use this product
Background​ADB (Android Debug Brigde) - is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps. adb provides access to a Unix shell that you can use to run a variety of commands on a device.
Research Walkthrough​For default, in Bluestacks, ADB port is open, but we can't to use shell command (output "error: closed")
Searching for information in the emulator files found the following file ".adbcmd" in Root.vnhd image. Path to file "dataFS\downloads". In this file we can see adb commands that we can run without connection to shell
For example, "getprop" command, that gives us information about android propetries
As we can see, interaction with android shell is working. So, I think "if I can interact with unix shell, maybe tryed to use pipe operators" and pwn i can interact with file system, but with shell-user privilage.
As a result i continue my search to find su command to get root access. SU file is in "/boot/android/android/system/xbin/bstk/su". I tryed pipe operator to get root access, but get error and shell didn't open(
After that i tryed list terminator ";" and it works. I get root shell
Result​Bluestacks have this vulnerability and people involved in its development know about it and are engaged in its elimination.
The real test is to see if you can actually do anything. Sure, you've ID'd as root, but will it actually let you change anything?
V0latyle said:
The real test is to see if you can actually do anything. Sure, you've ID'd as root, but will it actually let you change anything?
Click to expand...
Click to collapse
Thanks for your reply. Actually you can change in current session, but when emulator reboot, all changes remove. If we speak about system folders. In sdcard folders changes save. Sorry, I didn't mention it in the post.
When i searched information on the virtual disk, i found some scripts that build a system. That takes information from .conf files, but that works only for local work. For example, when you using OpenVPN Connect that port still open and you can interact with it.

Categories

Resources