Admin-Ahead Community

Linux => General Linux => Topic started by: vichithrakumart on August 12, 2018, 12:05:39 pm

Title: How to create custom commands
Post by: vichithrakumart on August 12, 2018, 12:05:39 pm
1. Create a directory bin under your home directory
2. Update your path variable to include this bin directory. Put this in .profile or .bash_profle file to make it permanent.

Code: [Select]
export PATH=$PATH":$HOME/bin"
3. Create a script on this directory and give execution permission

4. Reload .profile or .bash_profile

Code: [Select]
$ . ~/.bash_profile
5. You can simply type the script file name to execute the command