{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Recitation 1d: Aliases (PowerShell users, skip this section)\n", "\n", "Since we saw that `rm` is a wrecking ball, we should temper it using the `-i` flag. For safety, we would like `rm` to *always* ask us about deletion. We can instruct `bash` to do this for us by creating an **alias**.\n", "\n", " alias rm=\"rm -i\"\n", "\n", "After executing this, any time we use `rm`, `bash` will instead execute `rm -i`, thereby keeping us out of trouble.\n", "\n", "One of my favorite aliases is to make `ls` list things more prettily.\n", "\n", " alias ls=\"ls -FG\"\n", "\n", "The `-F` flag makes `ls` put a slash at the end of directories. This helps us tell the difference between files and directories. The `-G` flag enables coloring of the output, also useful for differentiating file types." ] }, { "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 }