Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Android Terminal Commands

OP rezo609

5th June 2012, 11:04 PM   |  #1  
rezo609's Avatar
OP Senior Member
Flag Dallas
Thanks Meter: 473
 
363 posts
Join Date:Joined: May 2012
More
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 11:19 PM.
The Following 22 Users Say Thank You to rezo609 For This Useful Post: [ View ]
1st October 2012, 09:09 AM   |  #2  
pdthekd's Avatar
Junior Member
Thanks Meter: 3
 
24 posts
Join Date:Joined: Apr 2011
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, 08:20 PM   |  #3  
Member
Thanks Meter: 49
 
53 posts
Join Date:Joined: Oct 2012
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, 09:53 AM   |  #4  
Act7's Avatar
Junior Member
Flag Vienna
Thanks Meter: 0
 
17 posts
Join Date:Joined: Mar 2012
More
free - see all free Memory from the Device
29th November 2012, 03:11 PM   |  #5  
Recognized Contributor
Flag Slovenj Gradec
Thanks Meter: 742
 
2,261 posts
Join Date:Joined: Feb 2011
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 04:36 PM.
The Following User Says Thank You to Lesicnik1 For This Useful Post: [ View ]
7th January 2013, 08:53 PM   |  #6  
Junior Member
Flag Athens
Thanks Meter: 0
 
4 posts
Join Date:Joined: Jul 2010
More
So practically the basic linux comands are the same with android terminal!!!
11th January 2013, 10:55 PM   |  #7  
sepehrthegreat-iran's Avatar
Senior Member
Flag urmia
Thanks Meter: 26
 
143 posts
Join Date:Joined: Jan 2013
More
I just noticed that the ping command is working just fine
Type ping 4.2.2.4 for example
18th February 2013, 04:15 AM   |  #8  
Junior Member
Flag San Diego
Thanks Meter: 5
 
25 posts
Join Date:Joined: Sep 2012
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 3 Users Say Thank You to toasterwater For This Useful Post: [ View ]
13th March 2013, 07:46 AM   |  #9  
Senior Member
Thanks Meter: 96
 
327 posts
Join Date:Joined: Sep 2012
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 07:57 AM. Reason: Added a command
23rd March 2013, 06:52 PM   |  #10  
Member
Flag Ljubljana
Thanks Meter: 5
 
52 posts
Join Date:Joined: Feb 2013
More
Tnx

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes