Execute custom script as command.

Create bash script, 

Create file: script.sh


date echo "testing" 


 Apply executable permission.

# chmod 0777 script.sh

Move script to /usr/local/bin/

# mv script.sh /usr/local/bin/


Now you can execute script from anywhere.

# cd /home/

# script.sh


Thu Nov 18 11:05:41 IST 2021



Popular posts from this blog

Error while connecting RDP "an authentication error has occurred the token supplied to the function is invalid".

Windows shared network printer issue in ubuntu 18.04

Rename printer from command line in ubuntu.