Post Page Advertisement [Top]

How to create global functions on linux?

It's just a simple step to be followed!
Create the function on ~/.bashrc

It is a hidden file located in your home folder. ~ indicates your home folder and you open it using vi editor as follows.
vi ~/.bashrc or
vi $HOME/.bashrc

Then append your functions as you want!
Example:

  • Create a function to start the apache tomcat server


To start the  Apache Tomcat, (Need root privilege - Type su)


To stop the  Apache Tomcat,


  • Add a banner to your shells

In this case, you'll have to call the function as above. Then the function will be called each time you open a new shell.


Bottom Ad [Post Page]

| Designed by Colorlib