Create linux shortcut for commands

Description:

Having long or medium commands we use pretty often, it comes in handy to create commands aliases in Linux.

Solution:

An alias can describe a command or a section of commands.

To define an alias:

> alias short_command=”do something that makes sense in Linux”

Example:

> alias gotoroot=”cd /projects/htdocs/my_project”

However, after reboot, the alias is lost. That’s when we need to add it to out bashrc file:

>vim bash_profile


>nano .bashrc 

Name of the profile file is variable, but location will always be in root.

 

About admin

Just another php developer trying to give something back to the community.
This entry was posted in Linux and tagged , , , , . Bookmark the permalink.

Leave a comment