Tag Archives: terminal

Inserting a function into all classes in a directory via Terminal

Or; Multi-line Search and Replace regular expression on the Command Line.

The situation

You have a single abstract class which is extended multiple times in 10 or 100 different classes throughout your codebase.

You’ve found a need for a new abstract method which all classes must now implement.

The problem

Who wants to manually insert that new code into all those classes!? (I don’t).

We need an automated way to do this
Continue reading

Tagged , , , , , , ,

Testing Cron Jobs for the correct user

Testing Cron Jobs in Linux can be a pain – especially if you’re using a tool like CPanel which abstracts away some of the processing. However, with a couple of quick commands, it’s possible to track down where your cron jobs may be failing and get them running smooth as silk.
Continue reading

Tagged , , ,

The Terminal 101

What is the Terminal?

The Terminal is simply a way to execute commands and to view the files on your computer. It is very similar to the Graphical User Interface that allows you to click around and shows you icons of files. The Terminal, however, is a text only environment.

The text only environment is a common source of frustration as it can often times be hard to see why a command didn’t work (eg; a typo), or know exactly which directory you’re in, or any number of other new concepts for first time users of the Terminal. Continue reading

Tagged ,