Termux command list
Hi guys, In this document, we are going to talk about a mobile Linux platform. Termux is a terminal emulator for android. We can use it to install Linux tools on a mobile phone. Here you can find a termux command list to do various tasks from your phoner.
I saw many of you guys are searching and asking about this, So I decided to write some stuff about this Terrmux environment.
You can download and install it directly from the play store. Since you are working with a Linux platform you can use many bash commands like cp, ls, pwd etc.
So let's see some commands we can use with the terminal emulator.
Directory and Files
You can get the current working directory by entering the command "pwd". pwd stands for "Print Working Directory".
$ pwd /data/data/com.turmux/files/home
The command "cd" can be used to change the current working directory. At the moment we are in the
/data/data/com.turmux/files/home directory. Let's change it to data/data/com.turmux/files and use pwd again.
$cd /data/data/com.turmux/files $pwd /data/data/com.turmux/files
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. We can simply use cd ../ command for this. Also if we want to go two steps backward we can use cd ../../ command. Just like that, we can go until the root directory.
We can get a list of all directories and files by using "ls" command. If we only use we hidden files will not be listed. (In Linux all files and directories those their name is starting with a single dot are hidden. You can use CTRL + H keyboard shortcut to un-hide them.) . If we use
ls -a we can list all files and directories including hidden ones.
To create a new directory you can use the
mkdir command. Let's combine "ls" command and "mkdir" commands in one example.
$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.
We can create a file with the touch command. The syntax is touch [filename].
$ls new.txt $touch test.c $ls new.txt test.c
We can delete a folder or a file with the rm command.
$ls data_folder1 data_folder2 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.
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 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.
apt-get install python
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.
apt-get install clang
If you want to install Metasploit on termux you need Ruby. Because MSF is coded in Ruby.
apt-get install ruby
If you are planning to learn hacking, Assembly is a must to learn. I suggest you write codes in C, Then disassemble them and learn Assembly.
apt-get install binutils
Turn your phone into a web server
You may know that using Python you can build a simple HTTP server. If you don't know about that read our python simple HTTP server tutorial.
You may use the following command to server on port 4444.
python -m SimpleHTTPServer 4444
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.
Some useful tools to install
- Linux man pages
These are the Linux manual pages for programmers. There are hundreds of documents explaining various API s and tools. For example, if we want to know about the read() function in C you can just type "man read". It will open a page explaining how to work with read function.
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 a file it'll create a new file and open it.
After you complete editing you may press ctr+o to write out to the file.
GDB is a debugger that 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.
apt-get install gdb
- Open SSH
This 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 SSH client install OpenSSH by entering the following command on your terminal.
apt-get install openssh
Networking related stuff
You may have heard something called "Hacker's swiss army knife". Yes, that is netcat. We can do much useful stuff with this tiny tool. I have good news for you. Netcat is already installed on termux by default. You can access it with the command nc.
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 all for today's tutorial. I know you also know some interesting stuff about the termux. Feel free to share them in the following comment section. Thank you for reading.