Termux Command List
Termux Command List
You can download and install it directly from the play store. You can see the
following screen after you launch it.
So let’s see some commands we can use with the terminal emulator. If you’re
familiar with Linux bash scripting this will be much easier. You can use the same
commands here also. however, I’ll explain all things assuming you’re totally new to
Linux/Unix environment. So without wasting any more time let's jump into the
content.
Copy
$ pwd
/data/data/com.turmux/files/home
However, there is a cool trick that can be used to print the current working
directory automatically. I’ll explain that later in this tutorial.
$cd /data/data/com.turmux/files
$pwd
/data/data/com.turmux/files
We don’t need to enter the full directory name if you want to navigate into a
subdirectory within the current working directory. Let’s say we are currently in the
directory /data/data/com.turmux/files. If there is a subdirectory as notes inside the
current directory we can simply jump into that directory by entering the command
cd notes. Let’s see it in the terminal.
$pwd
/data/data/com.turmux/files
$cd notes
$pwd
/data/data/com.turmux/files/notes
Now we're going to see another method to change the directory. Let’s say we are
now in /data/data/com.turmux/files/home/tools and we want to go one step
backward. That means the data/data/com.turmux/files/home directory. One
way to do this is the classic method of using the cd command with the absolute
path n /data/data/com.turmux/files/home/tools. Also, there is a shortcut method
for this. We can simply use the cd ../ command for this. That will do the same job.
$pwd
/data/data/com.turmux/files/home/tools
$cd ../
$pwd
/data/data/com.turmux/files/home/
/data/data/com.turmux/files/home/tools
$cd ../../
$pwd
/data/data/com.turmux/files/
$pwd
/data/data/com.turmux/files/home/tools
$cd ../../../config
$pwd
/data/data/com.turmux/config
Directory Listing
We can get a list of all directories and files by using the ls command. If we only use
hidden files will not be listed. (In Linux all files and directories whose names is
starting with a single dot are hidden. We can use CTRL + H in Linux or CMD + . in
Mac to un-hide them.) . If we use ls -a we can list all files and directories
including hidden ones.
$ls
data_folder new.txt
$ls -a
. .. .data data_folder new_folder new.txt
you can see that some directories and files were not listed in the first ls command.
But when we use it with the -a flag we got all items.
Creating directories
To create a new directory you can use the mkdir command. Let’s combine ls
command and mkdir commands as follows.
$ls
data_folder new.txt
$mkdir new_folder
$ls
data_folder new_folder new.txt
$mkdir .data
$ls
data_folder new_folder new.txt
$ls -a
. .. .data data_folder new_folder new.txt
At first when we used ls one file and one directory was listed. Next, I created a new
directory named “new_folder”. After I use “ls” again you can see our newly created
folder is listed there.
Creating files
We can create a file with the help of the touch command. The syntax is touch
[filename].
$ls
new.txt
$touch test.c
$ls
new.txt test.c
$ls
data_folder1 data_folder2 new.txt
$rm new.txt
$ls
data_folder1 data_folder2
$rm -r data_folder1
$ls
data_folder2
To delete a directory we used rm -r. If you don’t put -r you will be prompted for
confirmation.
Package managing
In Linux environments, we don't need to worry much about finding and installing
software. They are hundred of applications as packages. We can use commands to
install those in our system. In Debian-based systems, we use the apt package
manager. Termux developers also offer a large number of packages to install on
your device.
You can list all available packages by entering the command apt -list.
If you want to install a package you may use the command apt-get install
[package_name] or pkg install [package_name].
Make a programming environment
We can install some programming languages like Python, C, Ruby, etc on Termux.
Python
Python is the most used scripting language in hacking and penetration testing. We
use it to automate stuff and build tools. Also, Python is highly used in mashing
learning.
C programing
C language is the core language of many other programming languages. You can
learn computer architecture deeply if you get a good knowledge of C.
Ruby
If you want to install Metasploit on Termux you need Ruby. Because MSF is coded
in Ruby.
Assembly
If you are planning to learn to hack, Assembly is a must to learn. I suggest you
write codes in C, Then disassemble them and learn Assembly.
apt-get install binutils
Actually, we install the apache server on your termux environment. Not only
apache, PHP, and Python also can be installed. So you can run a fully functional
web server on your phone.
You may install the manual pages with the following command.
apt-get install man
Nano editor
This is a simple text editor that can be used in the terminal. We use this tool often
in Linux programming and text editing stuff. In the following image, you can see a
screenshot of the nano editor.
Let's say we want to edit a file called exploit.py. What you want to do is just type
nano exploit.py and hit enter. If there is a file called exploit.py nano editor will
open it in read mode. If there is no such file it'll create a new file and open it.
After you complete editing you may press ctr+o to write out the file.
GDB
GDB is a debugger that is used in the Linux platform. It is an awesome tool when
we come to exploit development and reverse engineering. You may learn more
about GDB from our debugging binaries with the GDB tutorial.
Open SSH
This is one of the most useful things you can do in the Termux environment. SSH
stands for Secure Shell. By using SSH you can access a Linux server from your
mobile.
To install the SSH client install OpenSSH by entering the following command on
your terminal.
Nmap
If you are interested in cybersecurity, I bet you are already familiar with this
awesome tool. Nmap stands for network mapper. It is used to scan networks.
So guys this is all for today's tutorial. Thank you for reading.
AUTHOR
CATEGORIES