Basic commands in termux.
List of All the Termux Basic Commands:
>Note: If any part of the command is green that means it is a variable. The green part of the code will change according to the situation.
Update all the packages and dependencies installed on the system:
apt update && apt upgradeIf any update is available it will ask you on the terminal if you want to upgrade or not, press Y if you want the update.
Grant storage permission:
termux-setup-storagenow you can access your Storage and all the folder in it using termux.
Know Which directory you are in:
pwd
List all the files and directories:
lsthis command will show you the folder and files in your current working directory.
List all the files and directories including Hidden Files:
ls -als command with -a will show you all the hidden files as well.
List all the files with file size :
ls -lhls command with -lh will show you all the files as well as their file size. you can also include -a which will become -lha and it will show you all hidden files in a list with file sizes.
Move forward in directories:
cd storagecd command allows you to move in a folder just type cd and the folder name you wanna move here I am moving in storage.
Move backward in directories:
cd ..by typing cd ..(between cd and .. we have to put space) you will go back in the directory you were in.
Clear Screen:
clearby typing clear in the termux you can clear all the previous results.
Create a folder or a directory:
mkdir folderNamemkdir Stand for make directory. Type mkdir and give a space and type folder name and press enter to see the folder you have just created just type ls.
Delete a folder or a directory:
rmdir folderNameRmdir stands for Remove Directory.Type rmdir space folder name to remove that folder.
Delete Non-Empty directory or folder in termux:
rm -rf folderNamePlease use this command with caution. This command will remove a folder and all the files and folders within it. This command is useful when you want to delete any project downloaded from Github.
Copy a file from one directory to another directory:
cp files-name file-pathYou can copy files by typing cp the file name and after giving a space you can type the path where you wanna copy the file E.g: cp virus.apk /storage/shared this will copy the virus.apk to the storage/shared folder.
Move a file from one directory to another directory:
mv files-name file-pathYou can move files by typing mv the file name and after giving a space you can type the path where you wanna move the file E.g: mv virus.apk /storage/shared this will move the virus.apk to the storage/shared folder.
Search for the specific package in termux:
pkg search package-nameIt will show you all the package related to that package name.
See the Details of a Package in Termux:
apt show nano
List all the available packages in termux:
pkg list-allit will show you all the packages that are available in the APT repository of termux.
Install a Package:
pkg install packageNameyou can install any package from the list, just type pkg install package-name.
Uninstall a Package:
pkg uninstall packageNameyou can uninstall any package from the list, just type pkg uninstall package-name.it will ask you where if you wanna delete the package or not press y and the package will be uninstalled.
Install Python in termux:
pkg install pythonJust type this command and it will be installed in your termux press y if it asks for confirmation. after installing python you can write code and also run your own python scripts. Type python to check if python is installed correctly or not.
Install Git in termux:
pkg install gitGit will allow you to download any project from GitHub.
Download projects from GitHub repository :
git clone Link-of-the-projectIf you want to download any project from the github you can just use the above just change the Link-of-the-project with your link
e.g: git clone https://github.com/khansaad1275/Termux-YTD
Download any file from Internet :
wget Link-of-the-fileIf you want to download any file from the internet you just have to change the Link-of-the-file with your link. see the below example. (The below command will just download a demo text file from the internet to your termux).
e.g: wget https://filesamples.com/samples/document/txt/sample1.txt
Check all the running processes in Termux:
topThis command will show you all the tasks running on your termux. To quit the top command on termux just press CTRL+C on your keyboard.
Make any bash file Executable :
chmod +x filename
If you are trying to run any bash file and you are getting a permission denied error then you can use the above command to make it executable
Create a text file in termux:
- First, you have to download a package name nano. Type on termux pkg install nano press y when asking for confirmation.
- Type nano on the terminal.
- Type anything you want I am typing hello world.
- Press CTRL+X and press Y to save the file.
- Give the file name anyname.txt and press enter.
- Type ls command to see your directory.
Create a new Empty file:
touch file-namecreate a new empty file or update the modification time of an existing file.
See what's inside a text file:
cat file-nameRun this command and everything in the text file will be printed on the terminal.
e.g: cat data.txt
Delete a file in termux:
rm file-nameTo delete any file within the directory, just type your file's rm name and press enter, and it will be deleted.
e.g: rm data.txt
List all the installed Packages in termux:
dpkg --listBy Using this command You will be able to see all the installed packages in your termux app.
List all commands that You have used in termux:
historyThis command will give you a list of all the recent commands that you have used in termux.
Check your Username :
whoami
This will show you the user-name in your termux.
See calendar in Termux :
cal
This command will display a calendar and show you the current date.
Check your Termux usage time :
uptime
This will show, How much time you have spent using termux.
Check your Kernel info in Termux:
uname -a
This will show you info about your system as well as you can also check your Architecture using this command.
Check Network Interface Configuration:
ifconfig
This command will show you your network information including your Local IP address.
Check Connectivity with any server/ping a server:
ping Ip-or-URL-or-the-server
send packets to a network host to check its connectivity. People also use ping to check their internet connection.
Example : ping google.com
Check your Memory Usage in Termux:
free -h -t
Set Alias in Termx ( Make your own command shortcuts):
alias d="cd storage/shared/Download"
Alias is the command that you can do to make shortcut commands. like in above example you can see that I have use "d" as a command to change my directory to the Download folder inside my internal storage. so now whenever I type d and press enter, I will be inside the downloads folder. You can change the above green code with your own example and learn it's working.
44 Comments
I don't know how to make termux work in my android phone
ReplyDeletejust read this post properly and you will easily understand the termux
DeleteYes i thought i would be hard thing for mw
Deletemm
DeleteThank you This commands Helps me to understand more about Termux
ReplyDeletewelcome my friend
DeleteIts very useful for the begineers of termux...
ReplyDeleteThanks For your valuable feedback ,I will add more commands in future
DeleteMy friend
ReplyDelete🥰
Deletegood
DeleteThank u bro..
ReplyDeleteNice app but how to hack others devise please reply
ReplyDeleteYou can search metasploit on my website
Deletei need target I'd command plsss give me
ReplyDeleteOf FaceBook?
Deletethank you so much for sharing such helpful commands and knowledge.
ReplyDeleteHii
DeleteThank you ❤👾
DeleteHow to download Kali Linux
ReplyDeleteTermux is sort of kali linux, Just scroll my site posts i have covered almost everything about hacking
DeleteHow to open installed tool
ReplyDeleteCommand please
if you are talking about github tools then cd && ls
Deleteand if you are asking about installed pkg then dpkg -a
Where is the pdf its not downloading
ReplyDeletesorry, i will remove the ads from the download link
DeleteIt worked for me. Nice post
ReplyDeleteThanks bro🙋🏻♂️
DeleteBrother I learnt many things from u thanks for that and
ReplyDeleteHow to stay hacking without root or without our IP.adress in termux
welcome bro!
DeleteJust use Termux it does not require any root and you can almost hack anything with it. for more details just scroll my site and you will see amazing things
I don't know usage of termux
ReplyDeleteScroll this site and you will learn everything about termux
DeleteNice tips bro...
ReplyDelete👑
Deletenice
ReplyDeletei m also learning termux
ReplyDeleteThanks for valueable info
ReplyDeleteHow can i study the ethical hacker in India. Help me sir......
ReplyDeleteGoood commandes but help me with commandes to hack free fire...
ReplyDeletePhone kaise hack krte hai termux se??
ReplyDeleteSearch Metasploit on my website
DeleteVery Nice tutor... I really love it
ReplyDeleteThank you <3
DeleteBro please make tutorial to install termux-widget
ReplyDeleteI have already written a post about how to install and use termux-widget here is the link https://www.learntermux.tech/2022/01/Termux-Widget.html
Delete