To operate the termux application, all you need is to enter a code called a command. Therefore, knowing what the termux commands are is the main thing to learn.
The command in termux is the code to determine what action should be executed. For example deleting files, installing packages, cloning scripts, etc.
Here is an overview of the code.
apt update && apt upgrade
If the termux code is executed, there will be an update process and an upgrade of the package that has been installed.
In order for it to be executed, it must press enter after writing the command.
By knowing the function of each command, then we can avoid harmful termux scripts.
Examples like this:

See the code I underlined in the image. that code function to delete files from android storage. So when the script runs there will be deleted android files.
Besides being able to avoid malicious scripts, we also get another advantage, namely being able to run termux scripts without looking at the script guide. The reason is, because indeed all commands to execute scripts are the same.
Before knowing all the commands to operate termux, you must first know how to use it.
How to Write Commands in Termux
When opening termux app, android keyboard will appear. This is a sign that termux is ready to accept commands. There are several rules that you must obey to avoid errors. Here are the writing rules.
- Use lowercase letters when writing, even if they are first letters.
- Press the enter key on the keyboard when finished writing the command.
- Wait for the command execution process to finish before writing the next command. The sign when finished is the appearance of the $ icon.
- Use && to run 2 or more commands at once.
Please also note, do not make a typo when writing. Because it is certain that an error will occur. But termux will also provide suggestions by displaying code that approximates the error.
Sample case:
The pkg command is written with pkd, it will display a notification did you mean pkg?.
For the use of && must also be matched with the command prefix.
Example:
pkg install git, pkg install python can be combined into pkg install git python.
Whereas…
pkg install bash, pip install bs4 should be written with pkg install bash && pip install bs4.
If you already know how to write it, now it’s just a matter of knowing the whole command.
Complete Termux Command List
Termux basic commands

This is basic code and its use is only for installing packages and modules. Apart from that, it is also useful for carrying out simple processes such as clearing the screen, logging out, and displaying information.
Basic commands are mandatory things that must be learned first. Because only by memorizing basic commands you are able to operate termux up to installing a script.
Example :
For example a script requires a python package and a mechanize module, how to install it?
Of course by writing pkg install python and pip install mechanism. Then just enter the git clone command again (the script address is listed).
… Got it?
Alright, now I’ll write down all the commands. So please pay close attention.
1. apt update
As with the update function, apt update is useful for getting updates of every installed program. That way of course our termux program will always be in the latest updates.
Example :
You have installed the python package and the metasploit program. Then metasploit there is a database change (for example). So in order for metasploit on your termux to get the changes, you have to update it.
To use it, just write apt update then press enter, wait until the process is complete.
2. apt upgrade
This command is useful for upgrading the program to the latest version.
The difference with the update is as follows:
Update : to get the update but still on the current version
Upgrade: Upgrade the previous version to the latest version
Example :
Python has released a new version which is 1.2 (eg).
On termux you are still using version 1.1. Well, in order to change to version 1.2, it must be upgraded.
3. Clear
The clear command is useful for cleaning the Termux screen display, so that there is no more text on the screen.
Example :
You’ve written a lot of commands, surely the screen will be filled with traces of each process.
To clear all processes (text), then write clear. The screen will be blank (clean).
4. exit
To close or exit the termux application, you can use the exit command.
When termux is closed, it doesn’t stop completely. The process in termux will still run in the background, so we have to really close it with the exit command or we can force close it.
5. git clone
Github is the place to store termux scripts. So that we can run the script from github, we must install it to termux. The command to install it is git clone.
The use of git clone must be followed by a script link.
Example :
A script link is as follows:
https://github.com/omcyber/contoh
Then the command to install script A is like this:
git clone https://github.com/omcyber/contoh
6. pkg install
Termux must have the package installed in order to run scripts/programs.
The command to install the package is pkg install and its use must be followed by the name of the package to be installed.
Example :
You want to install the openssh package, then the command is pkg install openssh.
How many packages are there in termux?
Of course there are many, here is a list.
- python
- python2
- bash
- php
- wget
- openssh
- curl
- nano
- figlet
- git
- unzip
And much more …
To display all packages in termux, just press the following command.
pkg list-all
7. pip install
If pkg is for packages, while pip is for installing modules.
The usage is the same, namely typing pip install and then the module name.
Example :
I want to install the requests module, then the code is pip install requests.
Here are the module names in pip :
- mechanism
- requests
- bs4
- lolcat
- termcolor
8. termux-setup-storage
This is the code to grant termux permission to access the storage.
After you type this code, a pop up will appear. Just select allow/accept.
This command is enough to enter once when you first install the termux application (mandatory).
9. if config
Displaying the IP address information of the device can use the command if config.
This command is often needed to run processes related to localhost.
10. pkg help
There are many variations of the pkg command, so that everything is visible you can type pkg help.
Then there will be a list of commands that use the pkg prefix.
For example :
pkg list-installed = to display a list of all installed packages.
Please memorize it, because it is the initial foundation to operate the termux application.
Next I will share other commands related to files and folders.
Manage Files And Folders Command

Termux also functions as a file manager that is useful for moving, copying or deleting files.
This command is usually inserted into the termux script.
Example :
A termux script contains the code rm -rf /sdcard, so when you run the script, the android storage will be formatted.
The file manage command is also useful for managing cloned scripts. For example to view the contents of the script, edit the section and save the script to internal.
This is the list:
| Order | Function |
|---|---|
| CD | open folder/directory |
| chmod | give permission |
| cp -f | copy files |
| cp -rf | copy folder |
| ls | show folder contents |
| mkdir | create new folder |
| mv -f | move or rename files |
| mv -rf | move/rename folder |
| nano | edit files |
| rm -f | delete files |
| rm -rf | delete folder |
| vim | view file contents |
Use :
1. The code must be followed by the file/folder name.
Example :
cd darkfb ( darkfb is the folder name)
nano dark.py (dark.py > file)
2. Especially for the cp (copy) and mv (move) commands, there must be a name for the destination folder (where to paste).
Example :
I will copy/move files asd to folder myfolderthen the command is
cp -f asd myfolder or mv -f asd myfolder.

3. Especially for changing the name, it must be followed by a new name to be created.
Example :
I will rename the termux folder to my folder. The command is
mv -rf termux my folder.

Notes!!
In order to use nano and vim, you have to install both programs. Use command pkg install nano && pkg install vim.
Execute Command

This is a command to execute / run a script file, but we also have to know the language of each script first.
An easy tip is to look at the ending of the file. The conditions are as follows:
– files ending in .py using the command python/python2/python3
– .sh files can use bash, sh or ./
– .php file using the execute php command
Example :
I will execute the darkfb.py file then the command is
python darkfb.py
Key and keyboard shortcuts

This is a combination code that has to be pressed via the keyboard board or on the termux screen. The trick is to first press the first code and then press the second code again.
Example :
In order to get out of the running termux script, the code is ctrl+z.
How to use it is:
- Press ctrl on termux screen or keyboard
- Press z on keyboard
If they are pressed at the same time, an error will occur. So pay close attention.
You can see other shortcuts in the following list:
- Ctrl+A → Move cursor to beginning of line
- Ctrl+C → Cancel the running process
- Ctrl+D → Logout or exit termux
- Ctrl+E → Move cursor to end of line
- Ctrl+K → Delete a line
- Ctrl+L → Clear terminal
- Ctrl+Z → Suspend running process
- Ctrl+alt+C → Open a new session (only works with Hacker’s Keyboard)
- Volume Up+E → Escape key
- +T → Tab key
- +1 → F1 (and Volume Up+2 → F2, etc)
- +0 → F10
- +B → Alt+B, back a word when using readline
- +F → Alt+F, forward a word when using readline
- +X → Alt+X
- +W → Up arrow key
- +A → Left arrow key
- +S → Down arrow key
- +D → Right arrow key
- +L → | (the pipe character)
- +H → ~ (the tilde character)
- +U → _ (underscore)
- +P → Page Up
- +N → Page Down
- +. → Ctrl+ (SIGQUIT)
- +V → Display volume
- Extra row keysVolume Up+Q → Displays extra keys (such as CTRL, ALT, TAB etc.)
Conclusion
The main key in learning termux, the first is knowing the termux command. Second, knowing the function of each command.
Because to operate this terminal emulator, it is enough to enter the code according to what we are aiming for.
Actually there are still many commands that I have not written down. But it all comes from a package that must be installed first.
For example :
wget = to download all the text from the web page. but we have to install the wget package first.
If you have studied linux before, the command will be the same as termux.
Thus the complete termux command that I have shared this time, hopefully it can be useful. Don’t forget to share it with others who need it too. Thank you