Basic Commands In Termux Part - 2 | Termux Command List Part - 2 | Termux Guide For Beginners

Basic termux commands part 2, if you are beginner and haven't read about part 1 read it first.

In this tutorial we are going to discuss about basic termux commands and use of that commands.

1. Command for update termux app

Following commands are used for update termux app. Commands are different but work of each command are same

pkg up

or

pkg update

or

apt update

or

apt-get update

2. How to use 'pkg' command in termux

There are following uses of 'pkg' command in termux.

(i) Install packages

pkg install PackageName

(ii) Reinstall packages at the latest version

pkg reinstall PackageName

(iii) Uninstall packages

pkg uninstall PackageName

(iv) Show all files in packages

pkg files PackageName

(v) Remove all outdated packages from .deb package cache

pkg autoclean

(vi) Remove all packages from .deb package cache

pkg clean

(vii) List all packages available in repository

pkg list-all

(viii) Upgrade all installed packages to latest version

pkg upgrade

3. Commands for clone github repository in termux

First you have to install git in termux for clone github repository. For install git in termux type following command

pkg install git

Now we can clone any github repository in our termux using link of that repository.

eg : I want to clone insfollow tool github repositry in termux.

Link of insfollow tool : https://github.com/termuxprofessor/insfollow

git clone https://github.com/termuxprofessor/insfollow

4. Command for run python script or '.py'script in termux

First we have to install python in termux by following command

pkg install python

This command will install latest vetsion python3 in termux.

If you wan to install python2 in termux, you can install it by following command.

pkg install python2

You can run python script or '.py' script in termux using following commands

pythonscriptname.py

If python script created by python2 you can run it by following command

python2 scriptname.py

5. Command for run bash script or '.sh' in termux

For run bash script or '.sh' script in termux first you have to give permission to that bash script using following command.

chmod +x scriptname.sh

After that you can run .sh script using 'bash' or './' command

bash scriptname.sh

or

./scriptname.sh

6. Command for open '.txt' file in termux

With the help of 'cat' command you can view any text file in termux.

cat filename.txt

7. Command for edit or modify '.txt', '.py', '.sh', or any other files in termux.

In termux 'nano'command has been used for edit or modify various files in termux.

nano scriptname.py

8. Command for open image or '.png' file in termux.

With the use of following command you can see image file in your smartphone's photoviewer app

xdg-open photoname.png

9. Command for give stoarge permission to termux

By following command you can give storage permission to termux.

termux-setup-stoarge

after typing this command you will get popup on termux which asks for storage permission, just allow it.

10. Command for keep running termux in background.

With the help of following command you can keep running termux in background by helding wake lock.

termux-wake-lock

For unlock wake lock type following command.

termux-wake-unlock

11. Command for install pip packages from 'requirements.txt' in termux

Most of github tools provides 'requirement.txt' file for easily install various pip packgaes in termux, which requires for run that perticular tool.

First you have to install python & pip in termux by following command

pkg install python

Now you can execute pip command for install packages from requirements.txt files by following command.

pip install -r requirements.txt

If you have any query or doubt tell us on our Telegram Group

Post a Comment

0 Comments