Author: Rama Subrahmanyam
1. 'alias' for most used commands:-
There will be commands that are used repeatedly, for which we can have a shortcut using an alias. For example, for cd commands, we can have
alias cd1="cd .."
alias cd2="cd ../.."
alias cd3="cd ../../.."
alias cd4="cd ../../../.."
alias cd5="cd ../../../../.."
*Put these in your .bashrc to save permanently.
2. 'ctrl-r' to search:-
Pressing the up arrow till you reach that one previous command..? Yeah, it's painful. ctrl-r referred to as "reverse search" will be of help.
First, press ctrl-r and then enter any part of the previous command. It gives you the last command which had that part.
3. 'diff' to know the difference:-
The difference between given files can be found easily with this command. Just do:
diff file1 file2
You will at least know whether both files are the same or not. As said in the book, "the output is not straightforward."
4. 'HISTCONTROL' to remove duplicates in history:-
Yeah, everyone has a history of repeating the same command even though we know it won't work... (are you still doing this?)
But this makes our history store multiple copies of the same command. Just add an environment variable called HISTCONTROL:-
HISTCONTROL='ignoredups'
You can even export this variable (export HISTCONTROL='ignoredups'), and continue to immerse in the sea of repeated commands ;)
*Put it in your .bashrc to save permanently.
5. 'Vim' - a classic editor:-
Nope, it is not the dish soap - Vim is a famous editor, for sure it'll become your favorite one, once you know how it works.
You will know the basics of vim when you enter the following command:-
vimtutor
The commands, some intuitive, some weird, some tough-to-remember, all will be there; but once you adapt to them, you will feel good, or even better...
Thank you for reading, so, yeah these are the top 5 picks from the book, and of course, there are many others, like:-
disk management, installing and removing packages, customizing your command line, etc. Of course, it is a book of 101 hacks...
Have you read the book already? Or do you come across any super-cool technical books, don't forget to share about them in comments and help us reach 'the Eternal thing'..!
This article is written as a part of The Bloggers League conducted by Vidhya Thakkar Neelam Sharma and Siddhi Palande powered by Penguin India, Dreamland Publications and Acclidesign should not be repurposed, republished or used otherwise. The content herein is owned by the blogger. Hosts are not responsible for any infringement caused.”
These hacks are very interesting to know. This book looks very insightful as well. Thanks for sharing the hacks as well as the link to the book.
ReplyDeleteHey thanks for this I didn’t know how much I needed this post until I read it
ReplyDeleteWow this is so detailed and well presented.
ReplyDeleteThank you for these interesting tips
ReplyDeleteWow thanks for this blog. Sounds interesting!
ReplyDeleteWow! Did not know about this!
ReplyDeleteI loved working on Linux in college. I had the opportunity to work on it again for a project at work, and it is one of my most favorite projects ever.
ReplyDelete