All Terminal Emulator Commands for Android

ยท 572 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 ๐Ÿ”—

commandmeaning
lslist all files and directories inside in the current directory
ls /sbinlist all files inside /sbin which are the system programs because /sbin is where system programs go
cdchange directory to home directory
cd ~change directory to home directory
cd /system/etc/change directory (a.k.a move) to /system/etc/ directory
pwdprint working directory. show the path of the current directory.

dealing with files ๐Ÿ”—

commandmeaning
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.txtcreate a new empty plain text file named file.txt in the current working directory
mkdir dir2create a new directory named dir2 in the current working directory
rm filename4.txtremove the file filename4.txt in the current working directory

show sizes of files and directoroes ๐Ÿ”—

commandmeaning
dfshow sizes of all files inside the current working directory
ls -Ahlshow sizes of all files inside the current working directory
du -hd 1show sizes of all directories inside the current working directory

dealing with Android applications ๐Ÿ”—

commandmeaning
pm list packageslist all installed applications
pm list packages | grep 'google'list the installed applications filtered by “google”
pm uninstall -k --user 0 com.example.appuninstall the app with com.example.app package name
pkg installinstall a new app
pkg updateupdate an installed app
pkg removeuninstall an app

change to root permissions ๐Ÿ”—

commandmeaning
suchange to the super user (su) to get the root permissions

dealing with terminal emulator app ๐Ÿ”—

commandmeaning
exitclose the terminal emulator app
rebootrestart the Android smartphone
uptimeshow the uptime from the last time the smartphone restarted/started
envshow all environment variables

plain text manipulation ๐Ÿ”—

commandmeaning
cat thatText.txtshow all text content of thatText.txt file
grep -rnw somefile.txt -e "that text"search for that text inside the file somefile.txt
sedadvanced tool to search/replace text
awkadvanced tool/language to search/replace text
echo "some text"print “some text” on the terminal standard output (stdout)
vima powerful plain text editor and code editor
nanoa simple enough plain text editor

Internet & network commands ๐Ÿ”—

commandmeaning
ping 8.8.8.8ping Google to check if the Internet is working
sshlog in other network-connected computers such as servers

Managing the Android device ๐Ÿ”—

commandmeaning
toplist all running processes
pslist all running processes

more commands ๐Ÿ”—

commandmeaning
amstart or stop any file or application
am start -n com.example.app/.MainActivityopen the app com.example.app
am force-stop com.example.appforce stop that app
am runninglist all running apps
am startservicestart a service
am stopservicestop a service
am dump permissionshow all permissions required by all apps
applypatchinstall a custom ROM or upgrade the Android operating system
bmgrbackup 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 , Facebook , Telegram and GitHub .

Share: