FORUMS

Analysis & Opinion

Top Forum Discussions

Android Terminal Commands

363 posts
Thanks Meter: 486
 
By rezo609, Senior Member on 5th June 2012, 10:04 PM
Post Reply Subscribe to Thread Email Thread
Here are a few commands for Android in terminal. If you have any commands that you think should be here, just reply. Enjoy!

chmod - give/take rights away from files. The numbers you see in the how-to's is a little complicated. It has to do with the rights you are assigning the file or folder. http://wiki.linuxquestions.org/wiki/Chmod for further reading.

cat - look at, modify, or combine a file. You can also copy files with this command by "reading" it to another file instead of to the screen.

cd - change from one directory to another

cp - Copy a file from one location to another

dd - copies exact locations to other locations. Can be an entire drive, a folder, etc.

dd if= of=. uses an input file and an output file.

exit - exits the shell you are in. When you type su you start up a shell.

ls - lists all files with in a directory try ls - l too.

mv - Move a file from one location to another. At the same time you can rename a file.

su - Substitute User. We type this to switch to the root user. You need to type this command first to do a lot of the other commands.

tar - creates taped archives. Compresses files like winzip, 7zip, winrar and others tar /? for details.
rm - followed by a file name with delete the file sync - synchronizes any data on disk with data in memory. We type this before rebooting to ensure we've got all data written

Other commands of interest:

df - how much free disk space. In linux you can add a switch "df -h" but the "-h" does nothing for me on Android. top - like task manager, it displays running processes. in Linux the q key quits. On Android I don't know how to make it quit other than closing the app. uptime - displays how long it has been since you last rebooted the system.

busybox - a tool that combines many linux commands into a single compact file. Typing this displays all the commands at your disposal.

busybox df - a much easier to read display of free diskspace. This display shows how full (use%) each file system is.
Last edited by rezo609; 5th June 2012 at 10:19 PM.
The Following 26 Users Say Thank You to rezo609 For This Useful Post: [ View ]
 
 
1st October 2012, 08:09 AM |#2  
pdthekd's Avatar
Junior Member
Thanks Meter: 3
 
More
Thumbs up Thanks
thank you so much, well for a noob like me very informative was looking for this kind from very long
25th November 2012, 07:20 PM |#3  
Member
Thanks Meter: 50
 
More
Substitute user XD you know it is superuser right?
The Following 4 Users Say Thank You to mid-kid For This Useful Post: [ View ]
29th November 2012, 08:53 AM |#4  
Act7's Avatar
Junior Member
Flag Vienna
Thanks Meter: 0
 
More
free - see all free Memory from the Device
29th November 2012, 02:11 PM |#5  
Recognized Contributor
Flag Slovenj Gradec
Thanks Meter: 747
 
More
Quote:
Originally Posted by mid-kid

Substitute user XD you know it is superuser right?

Actually substitute user is also correct.

"The su command, also referred to as substitute user, super user, or switch user, allows a computer operator to change the current user account associated with the running virtual console."

Source: http://en.wikipedia.org/wiki/Su_(Unix)

Sent from my Galaxy Nexus using xda premium
Last edited by Lesicnik1; 29th November 2012 at 03:36 PM.
The Following User Says Thank You to Lesicnik1 For This Useful Post: [ View ]
7th January 2013, 07:53 PM |#6  
Junior Member
Flag Athens
Thanks Meter: 0
 
More
So practically the basic linux comands are the same with android terminal!!!
11th January 2013, 09:55 PM |#7  
sepehrthegreat-iran's Avatar
Senior Member
Flag urmia
Thanks Meter: 26
 
More
I just noticed that the ping command is working just fine
Type ping 4.2.2.4 for example
18th February 2013, 03:15 AM |#8  
Junior Member
Flag San Diego
Thanks Meter: 7
 
More
Quote:
Originally Posted by rezo609

If you have any commands that you think should be here, just reply. Enjoy!

svc data enable - turn on mobile data

svc data disable - turn off mobile data

svc wifi enable - turn on wifi

svc wifi disable - turn off wifi

svc help - show information about subcommands
The Following 5 Users Say Thank You to toasterwater For This Useful Post: [ View ]
13th March 2013, 06:46 AM |#9  
Senior Member
Flag Chengdu
Thanks Meter: 139
 
More
For the top command mentioned in the OP, just type "top -n 1" and it will exit, leaving you with the readout at the time you executed the command. -n is for number of updates before stopping.

Also will add that the powertop command will show the top reasons for wakeups from idle.
Last edited by wangdaning; 13th March 2013 at 06:57 AM. Reason: Added a command
23rd March 2013, 05:52 PM |#10  
Member
Flag Ljubljana
Thanks Meter: 6
 
More
Tnx
23rd March 2013, 07:46 PM |#11  
RoberGalarga's Avatar
Senior Member
Flag In front of my laptop :D
Thanks Meter: 265
 
More
Quote:
Originally Posted by Metalcorpe

So practically the basic linux comands are the same with android terminal!!!

Yep

Quote:
Originally Posted by rezo609

If you have any commands that you think should be here, just reply.

grep - Useful to apply filters to other commands. For example, to list only the apk files inside a folder:
Code:
ls /folder/to/list | grep apk
or to search a string inside a file:
Code:
cat /file | grep stringToSearch
logcat - Debugging tool, all the system messages are shown here. To show only the debug messages (useful when an app is giving FC without apparent reason), type:
Code:
su
logcat -d


mount
- The most common use for this command is remount the system partition, to modify its content (be careful, you can easily brick your device!). Common usage (needs root):
Code:
Mount /system in Read/Write mode:
mount -o rw,remount /system

Mount /system in Read Only mode:
mount -o ro,remount /system
Saving command output to file. Type
Code:
command >> /folder/to/save/file
If the file doesn't exist will be created, otherwise, the info will be added to the end of the file.
You can also use:
Code:
command > /folder/to/save/file
If the file doesn't exist also will be created, but if the file exists its content will be deleted before add the info.

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools
Display Modes