It’s been a long time since I’ve posted, but it’s been a really busy period..
On to the topic, using a feature such as aliases in a terminal, certainly makes you do things faster.
(To get an intro to aliases and a guide on how to save them permanently, read this)
So I’ve gathered some of mine and uploaded them at Github as a bash-aliases repo.
Here are some:
alias c='clear' # also, Ctrl + L works nicely
alias ls='ls -l --color=auto' # list files, colored output
alias agi='sudo apt-get install'
Append them over to your ~/.bash_aliases file
The above are merely some of the aliases I am using.
In case you have anything to recommend, you could reply here with a comment, or even better fork the project@Github and then create a pull request (more info here).
Also, since we’re taking about terminal productivity tips, a must shortcut to mention is the one of recursive command search.
That is Ctrl + R.
Let’s say you are working on project that is hosted on heroku and you have typed this sequence for the local repo
[code language=”bash” gutter=”false”]
git add <new-file>
rails g model modname
And now you are ready to upload the changes to your heroku repo. What you need to do is push them, which if you have typed it before could be easily found using the recursive search.
So, hit Ctrl+R and write push, then you’ll see the command you want, i.e. git push origin master
If that’s not the command you want then hit Ctrl + R again, so that you get the 2nd result that matches your search.