All Terminal Emulator Commands for Android Mar 9, 2024
ยท
569 words
ยท
3 minute read Terminal is a program to use your operating system in a CLI mode. CLI stands for command line interface. Terminal emulator is a program to emulate the terminal on Android smartphones.
Here are all the commands for the Android terminal emulator.
moving between directories ๐ command meaning ls
list all files and directories inside in the current directory ls /sbin
list all files inside /sbin
which are the system programs because /sbin
is where system programs go cd
change directory to home directory cd ~
change directory to home directory cd /system/etc/
change directory (a.k.a move) to /system/etc/
directory pwd
print working directory. show the path of the current directory.
dealing with files ๐ command meaning cp /home/something.png /mounted/dir/
copy the file something.png
from /home/
directory into /mounted/dir/
directory mv /home/something.jpeg /mounted/dir/
move the file something.jpeg
from /home/
directory into /mounted/dir/
directory touch file.txt
create a new empty plain text file named file.txt
in the current working directory mkdir dir2
create a new directory named dir2
in the current working directory rm filename4.txt
remove the file filename4.txt
in the current working directory
show sizes of files and directoroes ๐ command meaning df
show sizes of all files inside the current working directory ls -Ahl
show sizes of all files inside the current working directory du -hd 1
show sizes of all directories inside the current working directory
dealing with Android applications ๐ command meaning pm list packages
list all installed applications pm list packages | grep 'google'
list the installed applications filtered by “google” pm uninstall -k --user 0 com.example.app
uninstall the app with com.example.app
package name pkg install
install a new app pkg update
update an installed app pkg remove
uninstall an app
change to root permissions ๐ command meaning su
change to the super user (su) to get the root permissions
dealing with terminal emulator app ๐ command meaning exit
close the terminal emulator app reboot
restart the Android smartphone uptime
show the uptime from the last time the smartphone restarted/started env
show all environment variables
plain text manipulation ๐ command meaning cat thatText.txt
show all text content of thatText.txt
file grep -rnw somefile.txt -e "that text"
search for that text
inside the file somefile.txt
sed
advanced tool to search/replace text awk
advanced tool/language to search/replace text echo "some text"
print “some text” on the terminal standard output (stdout) vim
a powerful plain text editor and code editor nano
a simple enough plain text editor
Internet & network commands ๐ command meaning ping 8.8.8.8
ping Google to check if the Internet is working ssh
log in other network-connected computers such as servers
Managing the Android device ๐ command meaning top
list all running processes ps
list all running processes
more commands ๐ command meaning am
start or stop any file or application am start -n com.example.app/.MainActivity
open the app com.example.app
am force-stop com.example.app
force stop that app am running
list all running apps am startservice
start a service am stopservice
stop a service am dump permission
show all permissions required by all apps applypatch
install a custom ROM or upgrade the Android operating system bmgr
backup all files or the OS
I hope this post helps you. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube
, Twitter (x)
, LinkedIn
, and GitHub
.