What are files, and how can we work with them from the command line? How can we continue to work collaboratively?
We’ve learned how to:
mkdir in Linux/Unix or New-Item -ItemType Directory in PowerShellcd and pwd OR Set-Location and Get-Locationls OR Get-ChildItemtouch OR New-ItemBut what exactly are files?
The Many File Formats
A file is a collection of data stored in a single unit, identified by a filename.
Files can be:
The file extension is the part of the file name after the period.
| Extension | Type |
|---|---|
.docx |
Microsoft Word document |
.jpg |
Image file |
.mp3 |
Audio file |
.txt |
Plain text file |
.md |
Markdown file |
Some file formats depend on particular software ecosystems.
For example, .docx files are designed for Microsoft Word and similar word processors.


To be clear, .doc was invented in 1983 along with the first version of the software for Microsoft Word which ran on MS-DOS, whereas .docx was only introduced in 2007 as part of an XML-based update to the software.
Open or plain text based formats are easier to inspect directly.
.txt files work with any text editorA Word Document and a .txt file might look the same…
But Word contains hidden formatting that .txt does not.
In programming, we want to be explicit - so plain text is preferable.
According to the Unicode Standard:
Plain text is a pure sequence of character codes; plain Unicode-encoded text is therefore a sequence of Unicode character codes.
Key concept: Plain text shows if it is formatted or not (we call this markup), and usually contains no formatting.
Who has heard of the Unicode Consortium?
Plain text is:
Edited in a text editor like VS Code

Founded by Michael Hart at UIUC in 1971
Project Gutenberg focuses especially on public domain texts.
That means many works can be legally:
How did Project Gutenberg initially start creating digital texts? What is Public Domain Day?
curl Commandcurl = “client URL” - downloads files from the internet> = redirect output to create a new file.txt file with the book’s textUsing WSL/Ubuntu:
macOS / WSL / Linux
cat usually works in PowerShell as an alias for Get-Content.
macOS / WSL / Linux
macOS / WSL / Linux
Pride and Prejudice has 14,911 lines.
macOS / WSL / Linux

How many lines include “pride”?
macOS / WSL / Linux
Result: 43 lines
Your turn: How many lines include “prejudice”?
| Command | What it does |
|---|---|
curl / wget |
Download files from the web |
cat |
Display file contents |
wc -w |
Count words |
wc -l |
Count lines |
grep |
Search for text |
grep -c |
Count matching lines |
What do you know about Markdown?
.md)README.md files!Like .txt, but with lightweight formatting capabilities.
Put two asterisks on either side:
Renders as: Culture as Data asks how cultural materials become structured data.
Put one asterisk on either side:
Renders as: Culture as Data asks how cultural materials become structured data.
Put a hashtag in front:
Different levels:
# = Heading 1## = Heading 2### = Heading 3Markdown Preview
Click the preview icon in VS Code’s top right corner
Plain text is future-proof
Can be rendered by any text editor
GitHub renders Markdown automatically
README.md displays on repository pagesMarkdown was created by John Gruber with Aaron Swartz in 2004.
The goal was to create a file format that was easy to read and write, could be converted into web documents, and could be used by anyone. You can read more about the history of Markdown, in Bednarski, Dawid. “The History of Markdown: A Prelude to the No-Code Movement.” Taskade Blog, March 25, 2022. https://www.taskade.com/blog/markdown-history/.
Aaron Swartz was connected to several open web projects.
| Model | What changes? |
|---|---|
| Project Gutenberg | Public domain texts, downloadable plain text |
| Creative Commons | Creators keep copyright but allow some reuse |
| JSTOR | Access shaped by vendors, libraries, and licenses |

Created by GitHub in 2009
Adds features like:
CommonMark is another popular Markdown style and improvements to it are discussed in this repository https://github.com/commonmark/commonmark-spec/issues.
Currently, your README.md is your first assignment Init IS310 Homework. What are some problems with this approach?
README.md should indicate structure of repo, not be one assignmentinit_is310Your first goal is to clean up your repository so that your first homework assignment has its own folder: init_is310.
That folder should contain your initial README.md and any images.
Then create a new README.md file in the root of your is310-coding-assignments repository.
Try adding:
You can use AI tools and the GitHub Markdown Cheatsheet to help you.
Push your changes to GitHub when done!
This assignment has two goals:
Your maze should be themed around your cultural data topic of interest.
Create a command line maze themed around your cultural data topic of interest for your group members to solve! First, you should create a new folder in your is310-coding-assignments repository called command-line-maze. Inside this folder, you should create a maze using directories and files.
Your maze should have:
Include a README.md in your maze folder:
Do NOT zip the README!
Dotfiles are hidden by default on Mac/Linux, but not always in PowerShell.
Mac/Linux/WSL:
is310-coding-assignments repoNeed inspiration? Try the example maze
Once your maze is posted, solve at least two mazes from students in your group!
Steps:
cat README.md)Mac/Linux/WSL:
| Command | Use Case |
|---|---|
cd |
Navigate through directories |
ls |
See what’s in each directory |
ls -la |
Find hidden files/directories |
cat |
Read file contents |
pwd |
Check current location |
For each of the two mazes you solve:
Pay attention to how your group members framed their cultural data topic!
Remember:
curl/wget, cat, wc, grep for text workSee also: Command Line Cheatsheet