In this post I am going to talk about how can we remain productive by creating bash aliases and save our time by creating easy to use shortcuts for repetitive commands.
What is Bash Alias
Bash Alias is more like a shortcut and it can be declared using the following command
alias alias_name = "command". Lets create a simple alias for listing hidden directories and files.
alias lm="ls -la"
note:there aren’t any spaces between the command and the name
Now we will be creating some useful bash aliases that we might use on daily basis
- git init (initializing git)
alias gi="git init"
- git push master (pushing files to GitHub)
alias gpm="git push your_repo_name master"
- listing files vertically
alias l="ls | more"
- Creating directories with a shortcut
- Removing Directory
alias r="rm -rf"
- Removing an Alias