Termux command list

HacksLand | The computer science playground

Posted by Thilan Dissanayaka on May 04, 2020

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 in a mobile phone. Hear you can find a termux command list.

You can download and install it from directly playstore. Since you are working with a Linux platform you can use many bash commands like cp, ls, pwd etc.

Directory and Files

You can get the current working directory by entering the command "pwd". pwd stands for "Print Working Directory".

$ pwd

The command "cd" can be used to change 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

Let's say we are now in data/data/com.turmux/files/home/tools and we want to go one step backward. That mean to the data/data/com.turmux/files/home directory . We can simply use cd ../ command for this. Also if we want tot 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 a one example.


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 the 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 touch command. The syntax is touch [filename].

$touch test.c
new.txt  test.c

We can delete a folder or a file with  rm  command.

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.

Hi, I'm Thilan. An engineering student from SriLanka. I love to code with Python, JavaScript PHP and C.

Also read

Aug 12
Functions and stack frames

Stack is a concept used in computer architecture to store temporary data. It is used to pass....

May 04
C programming strings

In our "Manipulating data with C" article we saw how we can store data in memory. We used the....

Aug 12
Error Handling | Python Programming

Errors are absolutely normal when programming. You may get hundred of errors while learning. Not....