Basic Commands in TermuxTermux is a great tool that allows you to access and Use advanced Linux tools without root on your android phone. Termux is Command-line based and to use this app the most basic thing you should know is commands. in this post we are going to learn about the most basic commands in the termux app.
If you know all the commands below you can easily navigate in termux and please practice this command so you can learn more advanced stuff more easily. if you wanna know why you must learn termux then check this post.[what is termux?]
List of All the Termux Basic Commands:You can run this command in a sequence to practice and know yourself how these commands work on termux.if you have any questions or ideas please comment I will be happy to help you.
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:
If 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.apt update && apt upgrade
Grant storage permission:
now you can access your Storage and all the folder in it using termux.termux-setup-storage
Know Which directory you are in:
This command will tell you, your present working directory
List all the files and directories:
this command will show you the folder and files in your current working directory.
List all the files and directories including Hidden Files:
ls command with -a will show you all the hidden files as well.ls -a
Move forward in directories:
cd command allows you to move in a folder just type cd and the folder name you wanna move here I am moving in storage.cd storage
Move backward in directories:
by typing cd ..(between cd and .. we have to put space) you will go back in the directory you were in.cd ..
by typing clear in the termux you can clear all the previous results.clear
Create a folder or a directory:
mkdir 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.mkdir folderName
Delete a folder or a directory:
Rmdir stands for Remove Directory.Type rmdir space folder name to remove that folder.rmdir folderName
Delete Non-Empty directory or folder in termux:
Please 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.rm -rf folderName
Copy a file from one directory to another directory:
You 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.cp files-name file-path
Move a file from one directory to another directory:
You 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.mv files-name file-path
Search for the specific package in termux:
It will show you all the package related to that package name.pkg search package-name
See the Details of a Package in Termux:
This command will show you the complete detail of a package.apt show nano
List all the available packages in termux:
it will show you all the packages that are available in the APT repository of termux.pkg list-all
Install a Package:
you can install any package from the list, just type pkg install package-name.pkg install packageName
Uninstall a Package:
you 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.pkg uninstall packageName
Install Python in termux:
Just 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.pkg install python
Install Git in termux:
Git will allow you to download any project from GitHub.pkg install git
Download projects from GitHub repository :
If you want to download any project from the git hub you can just use the above just change the Link-of-the-project with your linkgit clone Link-of-the-project
e.g: git clone https://github.com/khansaad1275/Termux-YTD
Check all the running processes in Termux:
This 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 :
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 executablechmod +x filename
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.
See what's inside a text file:
Run this command and everything in the text file will be printed on the terminal.cat file-name
e.g: cat data.txt
Delete a file in termux:
To delete any file within the directory in, just type the rm name of your file and press enter and it will be deleted.rm file-name
e.g: rm data.txt
List all the installed Packages in termux:
By Using this command You will be able to see all the installed packages in your termux app.dpkg --list
List all commands that You have used in termux:
This command will give you a list of all the recent commands that you have used in termux.history
Check your Username :
This will show you the user-name in your termux.whoami
Check your Termux usage time :
This will show, How much time you have spent using termux.uptime
Check your Kernel info in Termux:
This will show you info about your system as well as you can also check your Architecture using this command.uname -a
Check your Memory Usage in Termux:
This will show you the amount of free and used memory in the system.free -h -t
The above commands are very basic commands and it will not make you a hacker but trust me it will be in use whenever you are using terminal or termux. learning to operate on CLI (command line interface) is really important if you wanna become a hacker. I didn't include all the commands but almost everything important is there, You can also Checkout my [Top 10 Termux Secret commands ] If you think I missed something, you can comment I will include that in this post. Learn How you can hack social media accounts using termux. If you wanna make termux easier then you can install FishShell in termux, It will give you auto suggestions in termux.Thanks For reading Guys and as always Stay Ethical.