The file will be automatically loaded in your next session. For organizations purposes you can leave a comment before your aliases something like this: #My custom aliasesĪlias home=”ssh -i ~/.ssh/mykep.pem ” alias ll="ls -alF" For example, you can add them in the end of the file. bashrc file with your favorite editor like this: $ vim ~/.bashrcįind a place in the file, where you want to keep the aliases. The only difference comes from the fact that you will be saving it in a file this time. The syntax you should use is practically the same as creating a temporary alias. To keep aliases between sessions, you can save them in your user’s shell configuration profile file. If you wish to save your aliases across sessions you will need a permanent alias. If you open new terminal session, the alias will no longer be available. The problem with that alias is that it will only be available for your current terminal session. You can then use "wr" shortcut to go to the webroot directory. Here is an actual example: $ alias wr=”cd /var/www/html” The syntax is as follows: $ alias shortName="your custom command here" What you need to do is type the word alias then use the name you wish to use to execute a command followed by "=" sign and quote the command you wish to alias. You can create two types of aliases – temporary ones and permanent. ![]() How to Create Aliases in LinuxĬreating aliases is relatively easy and quick process. You can create an alias with a single character that will be equivalent to a command of your choice.
0 Comments
Leave a Reply. |