3. Now, navigate to your target directory using ’cd dirname’, which should display the warning message you added in you ~/.bashrc file as shown in the following image.

How it works ?

Simple, whenever you enter ’cd’ command, bash executes our alias ’mycd’ whose code snippet takes the argument (directory name) that you pass to cd, and checks if it matches with target directory (/production in our case), when there’s a match, it echos the message onto console. You can use this logic to print out help messages/commands and more on your Linux boxes. Hope it helps.