Installations and Introduction to your Terminal

Installations and Introduction to your Terminal#

OBJECTIVES

  • Navigate files and directories using your terminal

  • Create, alter, and delete files using your terminal

  • Display basic information about files using bash commands

  • Use loops to execute programs from the terminal and store output

REQUIREMENTS

  • Jupyter notebooks and Jupyter Lab for use locally: Anaconda

  • VS Code Text Editor: VSCode

  • Terminal application with git installed. For windows users, the easiest approach is to download and install git for windows.

Using the Terminal#

In this exercise, our focus will be on using the terminal to navigate files and directories as well as to create and destroy files and directories.

Challenge#

Starting from /Users/nelle/data, which of the following commands could Nelle use to navigate to her home directory, which is /Users/nelle?

  • cd .

  • cd /

  • cd /home/nelle

  • cd ../..

  • cd ~

  • cd home

  • cd ~/data/..

  • cd

  • cd ..

  1. Using the filesystem diagram below, if pwd displays /Users/thing, what will ls -F ../backup display?

  • ../backup: No such file or directory

  • 2012-12-01 2013-01-08 2013-01-27

  • 2012-12-01/ 2013-01-08/ 2013-01-27/

  • original/ pnas_final/ pnas_sub/

  1. Using the filesystem diagram above, if pwd displays /Users/backup, and -r tells ls to display things in reverse order, what command(s) will result in the following output:

pnas_sub/ pnas_final/ original/
  • ls pwd

  • ls -r -F

  • ls -r -F /Users/backup