Table of Contents
Hey Guys, It’s me SaadMaqsood 🙋🏻♂️. So we all have seen hacker movies where hackers just use terminals to send SMS to normal people, and I am not talking about Chat with Friends using Termux 💬 That is just terminal base chatting, I am talking about sending normal text messages using your termux terminal. So in this post, I am going to show you how you can use Termux-APi to send text messages from your phone and I will show how you can make an SOS system with this simple command. you are gonna learn a lot of creative ways to use a single command so make sure you read this post well 👾.
Basics information about Termux SMS💬:
Now since we can send any message in one single command we can use other Linux commands to use this in any way we want. we can create a script that will send any sms after a certain time. we can create a shortcut to send an SOS message to someone with just a click of a button. wish someone happy birthday 100 times with just 5 lines of code. The use is endless and it all depends upon our imagination and skill to make something really awesome out of it. In this post, I will tell a few ways I use the termux-sms feature.
There are different ways we can use the termux sms commands and I am adding different Linux-based commands to enhance the workings of the termux-sms so read the below methods carefully to understand them well.
1) Send a normal text message using Termux:
To send SMS using the termux, you have to use termux-sms-send command and you can see in the below example how you are going to use it. The green part is the phone number of your friend or the person you wanna send the text to and in cyan you can see the text. just edit the colored part and the command will work fine.
Just once termux will ask permission to send sms, just allow and after that it will always work fine.
1.1) Send a normal text message using Termux with dual sim:
So if you are using 2 sim cards on your phone then you have to type the sim number in the above command too. if you are a single sim user like me, you don’t need to add this -s argument.
If you will put the wrong sim number or an invalid sim number then the command will be silently failed and the sms won’t get sent.
2) Send an SOS Message using Termux with a single key:
So since we can send sms with a single command like you have seen above, you can write it in a simple alias command to send an emergency text to your best friend so that he can take you out of the situation. below is a simple alias command example where if you will press “x” button on your keyboard and press enter, a secret sms will get sent to the person.
alias x=”termux-sms-send -n 7718000000 ‘This is an emergency, help me.'”
If you will copy and paste this command into your termux, press x, and enter, it will send a text message, make sure to edit the phone number. keep in mind that, if you will restart your termux, this alias thing will not work, so to make it permanent, you have to put this inside your bash.bashhrc file. You can use the below code to permanently add this in your bash.bashrc file BUT make sure you have changed the number and text before you press enter.
echo “alias x=’termux-sms-send -n 7718000000 “This is emergency text test“‘” >> /data/data/com.termux/files/usr/etc/bash.bashrc
3) Send Schdeuled Message using Termux ⏲:
Let’s say you are in a situation and you want to send a message exactly after 10 minutes then you can use the below code to make that happen. You can even schedule a birthday wish if you can time this correctly. In the below command, you just have to change the green part. that is the time and phone number and text message that you wanna send.
sleep 10m && termux-sms-send -n 704000001 This is a loop
You can also enter 10s for 10 seconds and 1h for an hour instead of 10m, also there is a package name “at” that you can use to execute this exactly at 12 o’clock or any exact time you want.
4) Send multiple Messages using Termux with single command ➿:
Sometimes in some situations, we text someone the same text like 100 times for example saying someone to pick up the call. It takes so much of copy and pasting and pressing enter, and a better way to do it is to just use the below command. The below command will send the text message as many times as you want, make sure to edit the message, and number the delay time as shown in the below image.
for x in 1..10; do termux-sms-send -n 7040000201 This is a loop new && sleep 3; done
Sending Messages using termux is a truly amazing thing that we can do, and this detailed post will guide you toward the journey of creative use of termux commands in general. now you know how you can use any boring command in multiple ways to schedule or loop them. So this was just one command of Termux-api and if you like it, make sure to check out my other posts on Termux API. If you want to know more about termux then make sure to check out my other posts too. If you have any comments or suggestions then use the comment section. thanks for reading guys, and as always, Stay Ethical 👾.