Termux Basic Tutorial

Hello everyone!

In this article, you will learn the basics of the Termux app. Termux is a terminal app developed by Fredrik Fornwall. It is a terminal for Android that allows you to run a Linux environment on your Android device. If you are a Linux user, you can skip this article and save time because Termux is all about Linux. And if you are new to Termux, then I will teach you.

Which Termux should you download
What is the meaning of that line? Do not be confused. Let me explain. Look, there is a Termux available in Play Store; though it is an official version of Termux but many things can not be done using this version of Termux due to the policy of Play Store. So you can download Termux from F-Droid. It's also recommended to download Termux from F-Droid from the official repository of Termux GitHub.

At this point, I will let you know some basic commands of Termux, which are used frequently in the Termux app. In the future, if you move on to any Linux operating system, these basic commands will also help you then. Let's learn.

ls
It is a list command. If you type 'ls' and press enter key, you will see all available files and folder lists like this.

~ $ ls
bin  folder  package-lock.json  storage  vite-project
~ $


mkdir
This command creates a new directory. You must write the directory's name after the "mkdir" word. Here is an example below.

~/folder $ mkdir folder
~/folder $ ls
folder


To make a directory or folder with space, you need to use a  Backslash before using space. Alternatively, you can use a Quotation mark with the folder name 

~/folder $ mkdir new\ folder
~/folder $ ls
folder  'new folder'
~/folder $ mkdir 'new new'
~/folder $ ls
folder  'new folder'  'new new'


Without using Backslash or Quotation mark, the command will create multiple folders.

~/folder $ mkdir new project
~/folder $ ls
new project


This command will create "new" and "project" two different folder .

cd
The command named 'cd' means to change directory. In the terminal, it is used to change the working directory of Termux.

If you open the Termux for the first time, you will see a "~" sign. It means the current working directory of Termux is the home directory.

To change the working directory, type "cd" and the directory name.

~/folder/folder $ cd src
~/.../folder/src $


Using the cd command, the folder must be available. You can see the available folder and file in your working directory using the ls command.

~/.../folder/src $ ls
index.js


If you are wondering how to go back after entering a new directory. Use .. double dot after the cd command. This will take you one step back from your working directory.

~/folder/folder $ cd src
~/.../folder/src $ cd ..
~/folder/folder $


You can use only the cd command to take you to the Termux home directory in one shot.

~/folder/folder $ cd
~ $



mv
This command moves your file to another directory. The mv can also rename a file or folder name. It's a multi-purpose command.

To move a file or folder to another directory, type mv and then the folder name. (make sure that the folder should exist where you are moving)

~/folder/folder $ ls
src  style.css
~/folder/folder $ mv style.css src
~/folder/folder $ ls
src
~/folder/folder $ cd src
~/.../folder/src $ ls
index.js  style.css
~/.../folder/src $


To rename a folder or file using the mv command, type mv and current name and then new name; here's an example.

~/folder/folder $ mv src source
~/folder/folder $ ls
source
~/folder/folder $



Conclusions
There are some most used Termux commands which I wrote about. I hope you learn something new. If you want to know about anything else, make a comment, and I will try to help you.

Thank you for reading the article completely.

Istiak Ahmmed Soyeb

I'm Soyeb, Now I'm a web designer. I chose my career as a web developer. I'm also a Blogger (Not Professional). And I love technology very much.

Post a Comment

Previous Post Next Post