Reference
Last updated on 2025-12-03 | Edit this page
Quick reference
Navigating the shell
pwd- print working directory
ls- list directory :
-
-
-l: list file information
-
-
-
-lh: list human readable file information
-
cd- change directory
Interacting with files in the shell
mkdir- make directory
cat- send file or files to output (in most cases, print to shell)
head- output first parts of a file or files
tail- output last parts of a file or files
mv-
rename or move a file or files. Syntax for renaming a file:
mv FILENAME NEWFILENAME cp-
copy a file or files. Syntax:
cp FILENAME NEWFILENAME >-
redirect output. Syntax with
cat:cat FILENAME1 FILENAME2 > NEWFILENAME rm- remove a file or files. NB: USE WITH CAUTION!!!
Git commands
Git cheat sheet handouts:
git init- create a new local git repository
git status- view the status of your files in the working directory and staging area
git add- tell git to start tracking a file, or a series of files
git commit- save file changes from the staging area permanently to the project history
git push- upload all commits to a remote repository, such as GitHub
git log- show history of commits in reverse chronological order
git diff- show changes made to tracked files
git pull- download upstream changes and merge them into your local repository
git remote add origin- add a remote repository named ‘origin’, to upload changes to or download changes from
Further reading
- The help pages of GitHub are a good place to start.
- GitHub has ‘activities’ which aim to explain how git works.
- GitHub also has interactive tutorials for their online version (GitHub Skills) and for using Git offline (Git-It).
- Atlassian has in-depth but clear tutorials on using git.
- Code4Lib 2008 lightning talk – Git and distributed cataloging: Slides by Galen Charlton drawing parallels between how git works and how cataloging should work.
Useful library-related Git repositories
- DavidChouinard/mrc_to_csv: Python script for converting MARC21 files to CSV, originally designed for the Harvard Libraries MARC21 records.
-
pymarc/pymarc: Python
package for reading, modifying, and writing records in MARC21 format.
- Package description: Pymarc
-
umd-mith/git-intro:
Slides introducing Git, aimed at Digital Humanities students, hosted on
GitHub pages.
- Rendered slides: High level intro to Git
-
ProjectMirador/mirador:
NodeJS package providing an interactive image viewer for cultural
heritage websites.
- Package website: Mirador
- edsu/microdata: Python package for extracting microdata (text given a machine-readable label) from HTML5.
-
dhtaxonomy/TaDiRAH:
Taxonomy of Digital Research Activities in the Humanities.
- As rendered by the Dariah Vocabs Service: TaDiRAH
-
OpenAPC/openapc-de:
Dataset of information on fee-based open access publishing.
- Viewer for the dataset: OpenAPC
- JiscMonitor/allapc: Python package providing an API and reporting system for aggregated APC (article publication charge) data.
-
fbkarsdorp/python-course:
Tutorial and introduction to programming with Python, aimed at
students/researchers in the humanities and social sciences, maintained
as a set of Jupyter Notebooks.
- Rendered version: Python Programming for the Humanities
-
openingscience/book:
The evolving guide on how the Web is changing research, collaboration
and scholarly publishing, maintained as Markdown files and rendered
using Jekyll (also used by GitHub Pages).
- Rendered book: Opening Science
-
programminghistorian/jekyll:
A collection of lessons useful to historians and people working in
libraries, maintained as Markdown files and hosted by GitHub Pages.
- Rendered site: Programming Historian