Droid Turbo Lollipop OTA, 2015 Moto G Leaked – XDA TV

Android Lollipop for the Droid Turbo has been released. That and much more … more

EVLeaks Shows Off Possible BlackBerry Android Phone

It wasn’t too long ago that we received reports of BlackBerry planning to use … more

Mysterious GG1 Google Device Stops by FCC. Glass v2?

As the year progresses, we draw further away from Google’s annual I/O … more

Material and Material Dark Hit Samsung’s Theme Store

The latest version of Touchwiz, launched alongside the Galaxy S6 and S6 Edge, … more

Android Terminal Commands

363 posts
Thanks Meter: 485
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. 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
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  
Thanks Meter: 50
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
free - see all free Memory from the Device
29th November 2012, 02:11 PM |#5  
Recognized Contributor
Flag Slovenj Gradec
Thanks Meter: 747
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."


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
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
I just noticed that the ping command is working just fine
Type ping for example
18th February 2013, 03:15 AM |#8  
Junior Member
Flag San Diego
Thanks Meter: 7
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
Thanks Meter: 130
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  
Flag Ljubljana
Thanks Meter: 6
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes