$ echo "your_password" | sudo -S
Here is what the above code is Doing:
1. echo “your_password” – This will print your password to the terminal.
2. | – This is a pipe. It takes the output of the previous command and uses it as the input for the next command.
3. sudo -S