Home Blog

Laravel Bash Aliases

September 14, 2017 | Devanand Bhoir |



Bash aliases are basically constant or [shortcode]. We can define a [shortcode] in our own words. 

For example, if you use the command {php artisan} many times and to save time and avoid syntax error we can:


Create Your Own Base Aliases follow the steps.


  1. First open ~/.bashrc file in a text editor that is found in your home directory. If you have the following lines commented then uncomment it or add these lines to your file.

          if [ -f ~/.bash_aliases ]; then

              . ~/.bash_aliases



  1. You need to open the .bash_aliases file, if it exists, you can add your all aliases in the file or if file does not exist, you have to create a file with the name .bash_aliases and add the alias


Example :-


  1. alias { alias short-code } = "{command name}"

    => alias art="php artisan"


  1. Save the file from terminal using the command:


          source ~/.bashrc


  1. If you define the alias as alias mk ="mkdir" then it will give error as


          alias: =mkdir: not found


   To avoid these errors use syntax as alias: =mkdir: not found


Thanks for visiting our blog. In case of queries or suggestions feel free to comment in the below comment section.

About the author


Devanand Bhoir

Have a experience  in Laravel, CakePhp, Joomla, Wordpress, AngularJs, MySql, HTML5.