Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,924 Members 45,135 Now Online
XDA Developers Android and Mobile Development Forum

Android Terminal Commands

Tip us?
(Last edited by rezo609; 5th June 2012 at 10:19 PM.)
rezo609's Avatar
Senior Member - OP
Thanks Meter 463
Posts: 359
Join Date: May 2012
Location: Dallas
Default Android Terminal Commands

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. 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.
The Following 21 Users Say Thank You to rezo609 For This Useful Post: [ Click to Expand ]
pdthekd's Avatar
Junior Member
Thanks Meter 2
Posts: 20
Join Date: 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
Thanks Meter 49
Posts: 53
Join Date: 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: [ Click to Expand ]
Act7's Avatar
Junior Member
Thanks Meter 0
Posts: 17
Join Date: Mar 2012
Location: Vienna
free - see all free Memory from the Device
(Last edited by Lesicnik1; 29th November 2012 at 03:36 PM.)
Recognized Contributor
Thanks Meter 736
Posts: 2,252
Join Date: Feb 2011
Location: Slovenj Gradec
Originally Posted by mid-kid View Post
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."


Sent from my Galaxy Nexus using xda premium
The Following User Says Thank You to Lesicnik1 For This Useful Post: [ Click to Expand ]
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Jul 2010
Location: Athens
So practically the basic linux comands are the same with android terminal!!!
sepehrthegreat-iran's Avatar
Senior Member
Thanks Meter 26
Posts: 143
Join Date: Jan 2013
Location: urmia
I just noticed that the ping command is working just fine
Type ping for example
Junior Member
Thanks Meter 4
Posts: 25
Join Date: Sep 2012
Location: San Diego
Originally Posted by rezo609 View Post
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 2 Users Say Thank You to toasterwater For This Useful Post: [ Click to Expand ]
(Last edited by wangdaning; 13th March 2013 at 06:57 AM.) Reason: Added a command
Senior Member
Thanks Meter 63
Posts: 277
Join Date: 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.
Thanks Meter 4
Posts: 48
Join Date: Feb 2013
Location: Ljubljana

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes