DEV Community

tamilvanan
tamilvanan

Posted on

creating your own command (executable script) in parrot os

hello hackers!

in this blog, i’ll share how i created my own command on my parrot os machine.

let’s get started! 🚀

step 1: create a new script

open a terminal and create a new script using nano:

nano mycommand
Enter fullscreen mode Exit fullscreen mode

step 2: add this code

inside the file, add the following:

#!/bin/bash
echo "hello! this is my custom command."
Enter fullscreen mode Exit fullscreen mode

press ctrl + x, then y, and hit enter to save.

step 3: make it executable

run the following command to give execution permission:

chmod +x mycommand
Enter fullscreen mode Exit fullscreen mode

step 4: move it to /usr/local/bin/

to make the command accessible from anywhere, move it to /usr/local/bin/:

sudo mv mycommand /usr/local/bin/
Enter fullscreen mode Exit fullscreen mode

step 5: run your command from anywhere!

now, you can type:

mycommand
Enter fullscreen mode Exit fullscreen mode

and it will print:

hello! this is my custom command.
Enter fullscreen mode Exit fullscreen mode

that’s it! you’ve successfully created your own custom command in parrot os. 🔥

Top comments (0)