This is a tip sheet and interactive activity for a hands-on session about using the command line for the 2025 NICAR conference.
The goal is to offer a fundamental, but hopefully not too basic introduction to using command-line programs on Mac OS. I'm trying to focus on areas where I've seen people struggle with using command-line programs in the newsroom.
This tutorial is intended for Mac computers in the hands-on lab at the conference.
If you have your own computer running Mac OS or Linux (including under the Windows Subsystem for Linux), you should be able to follow along.
If you're using a Windows computer without the Windows Subsystem for Linux or a tablet device such as an iPad, you're going to have a much more difficult time following along. You could try using JSLinux, but no guarantees that everything will work correctly.
If you're following along on a non-lab system, you'll need to clone this repository.
The tutorial portion is oriented around the Z shell (Zsh), which is the current default on Mac systems. Most, if not all, of the examples in the tutorial should work on other shells, but if you encounter errors, that may be the reason.
Finally, some of the examples in the tutorial assume you have csvkit installed.
tutorial: Instructions and data for the hands-on activity we'll walk through during the conference session. You should also be able to follow along on your own computer.tutorial/slides.md: Slides used during the conference session. These can be displayed using the slides tool.tipsheet.md: General tips and links to other references for using the command line.
The command line is by no means a set of tools and concepts specific to journalism. I've tried to use real data in this tutorial to ground the concepts in the kinds of ways I use the command line as a data reporter.
Agency: U.S. Immigration and Customs Enforcement
Link: Detention Management | ICE
Agency: U.S. Census Bureau
Link: National Population Totals: 2010-2019
Agency: U.S. Census Bureau
Link: National Population Totals: 2020-2024
Agency: Tucson Police Department