Note: This post is over a year old and so the information contained here might be out of date. If you do spot something please leave a comment and we will endeavour to correct.
When navigating the file structure in Unix/Linux environments you will often find yourself typing cd to change the directory and then immediately typing ls to see the contents of the directory.
It is possible to run ls automatically every time you run cd by adding the following commands to your .bashrc file.
cd() {
if [ -n "$1" ]; then
builtin cd "[email protected]" && ls
else
builtin cd ~ && ls
fi
}}
Timing web requests is possible in curl using the -w or --write-out flag. This flag takes a number of different options, including several time based options.
Creating a symlink is a common way of ensuring that the directory structure of a deployment will always be the same. For example you might create a symlink so that the release directory of release123/docroot will instead be just current.
I'm a proponent of automation, so when I find myself running the same commands over and over I always look for a way of wrapping that in an alias or script.
Grep is a really powerful tool for finding things in files. I often use it to scan for plugins in the Drupal codebase or to scan through a CSV or log file for data.
For example, to scan for user centric ViewsFilter plugins in the Drupal core directory use this command (assuming you are relative to the core directory).
Part of the process of putting a new site live can be moving DNS entries around. Prior to doing this it's a really good idea to sort out the Time To Live (TTL) of the DNS record so that when you do change DNS entries you aren't waiting around for a day for the DNS to sort itself out.