Custom command in linux

sometimes we don’t want to type long commands every time. we want to create scripts and run custom scripts easily. today I will show you How to create commands in Linux.

This is the command I will you how to create today, hello-command. we can type the hello command and pass one parameter when we run this command it will print hello followed by text that you insert in the parameter.

first, we create a script file name “”


before we write a file let’s take a look at file permission. the file has read and write permission.

we will change file permission to make the file can execute. use chmod command to change permission.

chmod +x

let list permission to see again, the file can have to execute permission

I like to use vscode to edit script use can use other editors you want


the script reads an argument and prints output Hello followed by the argument we insert when running the script.

#!bin/bashecho Hello $1

test the script to make it can execute correctly.

./ everyone

now we can create a custom script but can’t run it everywhere. when we change the directory and run the script again. it not working.

so, we will make it can run on everywhere. first, move to the directory where we create a script and move the file to /bin and remove suffix file to look prettier when we run the command.

cd <your-directory>
sudo mv /bin/hello-command

reopen your terminal and run the command again.

now, you can create your own custom script to reduce repetitive tasks and make your day more productive.

Thank you for reading & enjoy your coding 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s