As programmers, we often encounter blog posts, tutorials, forum posts, etc. where strangers on the internet offer us commands to run to solve some problem or accomplish some task.
In our rush to make progress in what we’re working on, it’s tempting to copy/paste and blindly run these commands without really understanding what they’re doing - but that can lead to trouble if the command is doing something you don’t want or expect it to do.
Knowing this, it’s always a good idea to do a little bit of research on any commands you don’t understand before you run them on your computer or server. Below our two resources I like to use for this research...
ExplainShell
ExplainShell.com takes any command and breaks it down piece by piece, pulling directly from the command manuals. As an example, plug the following command from my guide on upgrading PHP in and check out the results:
> sudo dpkg -l | awk '/^ii/{print $2}' | grep php | tee php-packages.txt
ChatGPT
ExplainShell is great for detailed technical documentation, but if I want a more “plain English” explanation of a command, ChatGPT is my new go-to tool:
Doubling back to the dangerous git command shown in the example above, ChatGPT even provides some words of warning about the command in question, telling us that it’s destructive and should be used with caution.