Interested In Results

This is like how I perceive bosses and managers: They come in grumpy everyday, and are not interested in hearing about your recent breakthroughs or moments of enlightenments… “Show me some results!!”.

Anyways, while writing a script, you might be interested in the output of a command, rather than the actual execution. Here is an example:

# pwd is a command that prints the current working directory$ sound_convert_to_caf `pwd`/*.mp3

Here, my dumb python script doesn’t take a relative path, nor resolves the current working directory, hence I must supply it with absolute paths. Using the back-ticks, one can easily resolve the absolute path! :D

Oscillation

Did you ever want to cd into a directory, but remembered the effort required to cd back into the current directory? Yeah, a basic solution would probably be:

$ cwd=`pwd`$ cd other_directory
$ cd$cwd

But! Another, much more elegant way exist that allows you to go back and forth between the two directories

Something Like… This?

Oh noes! You haz type cmd you can no longer .. have forgotten!!! Let terminal help you find it!!

Simply, hit Ctrl + r, and this will trigger the reverse search to allow you to do a fuzzy search on the commands you typed:

Example:

(reverse-i-search)`git ': git pull origin master

Recursion

This blew my mind, as I have never come across it earlier (lair, obviously, I probably just overlooked it). The /**/ syntax seems to be a recursion indication thing, not only in terminal, even in gitignore, for example.

$ images_convert_to_RGBA8888 directory/**/*.png

Conclusion

This is definitely just a fraction of what is truly helpful in terminal. I must be missing a few, and much, much more that I am still ignorant about…