Here are the Top 40 Termux commands you need to know.
1. If you don't know who you are,
execute whoami,
this will tell you your username.
2. to change your password
execute passwd,
and set your password.
3. use mkdir to create a directory
4. ls to list files and folder in your current directory,
-l flag to get in list form,
-a flage to list hidden stuff
To list them in a nice format, try tree
first install tree
then execute tree
5. If you don't know where you are,
use pwd,
this will print your current working directory
6. to change your current directory,
use cd and specify the directory name, you want to go.
to go back,
use cd ..
to go to your home directory just
use cd
7. touch is the best way to create a file.
touch and specify the file name
you can also create multiple files.
8. use rm to remove a file,
rmdir to remove a directory,
directory not empty,
use rm -r flag to remove the directory with all of its files and folders.
9. to install Any packages,
use pkg install and specify the package you want to install.
searching for a package,
use pkg search and specify the package you are searching for.
to list all the available packages
execute pkg list-all
To know all the installed packages,
execute pkg list-installed
to remove a package,
use pkg remove and specify the package you want to remove
10. To print something,
use echo Subscribe,
you can also save it to a new or existing file
echo "subscribe" >> tbot
11. To know the contents inside the file,
use cat command, and specify the file name
but this will print all contents at a time,
so better way is to use
less command, this will print 1 page at a time,
12. to copy your files ,
use cp specify the file name and where you want to copy it.
use -r flag to copy a directory
13. To move a file,
use mv specify the file name and where you want to move,
sane for directories.
14. if you dont want that no one should read your file content,
use shred command
15. to download a file from the internet.
use wget and specify the URL,
another way is to use curl,
curl URL > and give it a name
16. to conpress a file, install zip,
now use zip give name to your file and specify the file you want to compress
To extract it,
use unzip and specify the zip file
17. Another way to commpree is to use tar,
tar -c to create a archive, z to use gzip and f to specify your files name and the file or folder you want to compress
To exctact it use,
Tar -xzf and specify the file
18. To get your system information,
use uname -a
19. To know about your cpu,
execute lscpu
20. To know about your termux,
execute termux-info
21. to give storage access to termux,
exexute termux-setup-storage,
Now you can access your internal or external storage in termux
22. to open a url,
use termux-open-url and specify the url,
this will open only URLs,
but what about files,
use termux-open for that
another way is to
use xdg-open
23. to backup your termux,
use termux-backup and specify the output file in tar form.
24. To restore fron backup file
Use termux-restore and specify the file from which you want to restore
25. to reset your termux,
use termux-reset,
and y for yes
26. to know your free and used storage,
use free,
27. To check whose using your memory,
Use top,
To see in a better way install htop,
28. to make a file executable,
use chmod +x and the file name
now you can execute it.
29. to check the calender,
execute cal
30. to know the date,
execute date
31. Don't know your ipaddress,
Use ifconfig
want to sort it,
use grep
ifconfig | grep inet,
32. to find something,
use find command, and specify the directory in which you are searching in and -name and the file name
33. to edit a file,
use nano and the file you want to edit,
now to save it use ctrl x y and enter
34. If you dont know about any command, install man, then
use man and the comnand you didn't know,
it will tell yiu everythibg about the command,
another simple way is to use whatis,
35. to know where it is,
use whereis
36. To change your shell,
use chsh -s and specify the shell
, now if you restart termux, its changed
37. Want to remotely access termux,
install openssh,
execute sshd
now connect to termux with another machince using ssh
ssh youruser@youripaddress -p 8022
38. to know the running processs,
use ps -aux,
Use kill to kill a process,
First get the process id, then use
kill -9 to forcefully kilt it. and the process id
Another way is to use pkill, best thing about pkill is that you don't need to know process if
just use pkill and specify the process
39. To run termux in background,
Execute termux-wake-lock
To stop termux from running in background,
Use termux-wKe-unlock
40. To know your history,
execute history
41. to get factor of a number,
use factor and the number
42. Exit to get out of termux