{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Recitation 1e: Summary" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## You are now empowered\n", "\n", "With just a handful of commands, you are now all ready to manage files and navigate your way around the command line! Once you get the hang of it, you will find the command line very efficient and often preferable to using Finder (for Mac users). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Command line cheat sheet\n", "\n", "As a useful reference, here are all the commands we covered in this recitation, where the text in brackets represents the file or directory you are interested in manipulating:\n", "\n", "| Command | Description | \n", "| ---- | ---- |\n", "| `pwd `| print working directory |\n", "| `ls` | list contents of the current directory | \n", "| `cd` | navigate to your home directory | \n", "| `cd [dir]` | navigate to the specified directory | \n", "| `cd ../` | navigate \"up\" one directory, to the parent directory | \n", "| `mkdir [dir]` | make a new directory | \n", "| `rmdir [dir]` | remove an *empty* directory | \n", "| `cp [file] [dir]` | copy a file to a directory |\n", "| `cp [dir1] [dir2]` | copy a directory to a another directory |\n", "| `mv [file] [dir]` | move a file to a directory |\n", "| `mv [filename1] [filename2]` | rename a file |\n", "| `mv [dir1] [dir2]` | move a directory to another directory |\n", "| `rm [file]` | remove a file |\n", "| `rm -r [dir]` | remove a directory and all contents (**use with caution!**) |\n", "| `cat [file]` | display file to screen (best for small files) |\n", "| `head -n [file]` | display first $n$ lines of a file |\n", "| `tail -n [file]` | display last $n$ lines of a file |" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing environment" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPython 3.7.4\n", "IPython 7.8.0\n", "\n", "jupyterlab 1.1.4\n" ] } ], "source": [ "%load_ext watermark\n", "%watermark -v -p jupyterlab" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "*Copyright note: In addition to the copyright shown below, this recitation was developed based on materials from Axel Müller.*" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }