Skip to content

Instantly share code, notes, and snippets.

@bmoren
Last active January 22, 2020 14:56
Show Gist options
  • Save bmoren/fcab14823521fefc499c3b31e79190da to your computer and use it in GitHub Desktop.
Save bmoren/fcab14823521fefc499c3b31e79190da to your computer and use it in GitHub Desktop.
An adaptation of Melanie Hoff's Folder poetry workshop for a net-art assignment @ mcad

What if we could transform our online networks from something we passively receive to something we actively create? Folder Poetry is the practice of using the structure of computer folder organization as a new kind of poetic form like the haiku or iambic pentameter. By naming and nesting folders and files, we can create unfolding narratives, rhythmic prose, and choose-your-own-adventure poetry.

Terms

  • Folder Poetry is the practice of using the structure of computer folder organization as a new kind of poetic form like the haiku or iambic pentameter. By naming and nesting folders and files, we can create unfolding narratives, rhythmic prose, and choose-your-own-adventure poetry.
  • The Terminal is desktop application to control and make changes to your operating system by typing text commands. In this class we'll use the terminal to create folder poetry.
  • Bash is the programming language we'll use in the terminal, often one line at a time, but we can also put Bash code in a file and run that file.

Folder Poetry Rules

  • Every file has to contain text in it.
  • Underscores and dashes are ok. for example: my_file.txt or my-file.txt, case sensitivity matters! no spaces!
  • All files must have a file extension such as .txt

Terminal.app location

Applications/utilities/terminal.app

🎲 Bash & Terminal commands

Command Description
cd change directory
cd .. change directory one level back
ls list contents of directory
pwd print working directory
mkdir foldername create a folder named foldername .
touch dandelion.txt create a file named dandelion.txt
echo "woof woof" > kitty.txt create a text file called kitty.txt containing the words, "woof woof"
echo "bark bark" >> kitty.txt append the words "bark bark" to the end of text file called kitty.txt
cat filename.txt print contents of file
rm -rf filename.txt . remove a file or folder this way
mv filename.txt newfilename.txt rename a file (you can also move anywhere by providing filepaths)
open . open the current folder in Finder
open filename.txt open file in Text Edit
nano filename.txt open file in nano text editor (in terminal editor)
atom filename.txt open file in Atom.io
cp sourcefile.txt destfile.txt copy file (source filepath first, destination filepath second)
say "hello, what is poetic computation?" speak out loud
man cd show the manual for 'cd'. Press q to quit
source ~/.bash_profile restart your terminal config file
tree list file tree (if aliased, info below)
treefile list file tree with file contents (if aliased, info below)

Keyboard Terminal Shortcuts

Command Description
Up + Down Arrow keys scroll through history of commands entered
Tab Key autocomplete
CMD + CTRL + SPACE Emoji Keyboard (Mac OS)
CTRL + c escape the current terminal opperation
CTRL + x , y , enter exit nano and save/overwrite changes

Editing a text file

command Description
echo "woof woof" > kitty.txt creates a text file called kitty.txt that contains the words, "woof woof"
echo "bark bark" >> kitty.txt append the words "bark bark" to the end of text file called kitty.txt
nano textfile.txt open file in the nano text editor
CTRL + X , y , ENTER exit and save changes

Editing your ~./bash_profile

The ~./bash_profile is a configuration file for the terminal.

  1. nano ~/.bash_profile to open your ~./bash_profile in the nano editor

Copy the commands in steps 2,3,4 into the text area in nano

  1. alias tree="find . -not -path '*/\.*' -print | sed -e 's;[^/]*/;|;g;s;|; |;g'"

  2. alias treefile="find . -not -path '*/\.*' | xargs -I {} bash -c 'f={}; echo \$f | sed -e \"s;[^/]*/;|;g;s;|; |;g\"; if [[ \$f == *.txt ]]; then echo; cat \$f; echo; echo; fi'"

    • steps 2 and 3 create aliass AKA shortcuts that will help us visualize our folder poem structures.
  3. export PS1="\n🍋 \w\n\u$ "

    • This will customize your Bash prompt. Feel free to change the emoji. (skip if you use zshell)
    • Explanation: \w shows your full file path so you'll always know where you are in the terminal, \n creates a new line in your bash prompt. \u shows your computer username, and $ symoolizes the end of a bash prompt.

Terminal configured! time to exit nano and reset the session!

  1. CTRL + X to exit nano, then press Y for yes to overwrite the buffer, then press enter to save the file.

  2. source ~/.bash_profile to reboot your terminal session.

Making our Folder Poems

  • cd
  • mkdir folder-friends
  • mkdir folder-poetry
  • cd folder-poetry
  • mkdir yourname-home
  • cd yourname-home
    • ^ where we'll make our poems
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment