Computing Magazine

Create Linux Shortcut for Commands

Posted on the 31 March 2014 by Akahgy

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.

 


Back to Featured Articles on Logo Paperblog