{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Session 4: Linux Command Line\n", "\n", "Date: 10/02/2017, Monday" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This week we are going to use Harvard's [Odyssey supercomputer](https://www.rc.fas.harvard.edu/odyssey/). It is a Linux system, just like most remote servers. Before playing with Odyssey I strongly recommend you to get familiar with Linux basics." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Why command line, not graphical interface?**\n", "\n", "1. Command line is more like programming so it allows you to do much more, such as renaming 1000 files.\n", "\n", "2. When controlling a remote server, the internet bandwidth is typically not enough for showing the graphical user interface. But with command line you only need to transfer texts, not images.\n", "\n", "Linux commmand line is **an absolutely essential skill for any programmers** (much more important than MATLAB 🙂), so learn it!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Trying Linux command on your Laptop" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### On Mac" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Mac has a built-in app called *Terminial*. You can find it by searching for \"Terminial\" in *Spotlight Search* (`command+space`, or `control+space` for older OS). Mac command line is almost the same as Linux command line, so you can practice Linux commands on Mac without having to connect to Odyssey. This default terminal is already pretty good for beginners. If you want more advanced terminals, try [iTerm2](https://www.iterm2.com). \n", "\n", "For connecting to remote servers, simply execute `ssh username@ip_address` in the terminal." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### On Windows " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Window's own command line is **very different** from Linux's. On Windows 10, you can follow this [official tutorial](https://msdn.microsoft.com/commandline/wsl/about) to install the Linux subsystem, so you can play with Linux on your laptop. If you are using an older windows system, you can try some online Linux \"playground\" like https://www.tutorialspoint.com/unix_terminal_online.php.\n", "\n", "For connecting to remote servers, you can use the old [putty](http://www.putty.org) or try more advanced ones like [MobaXterm](https://mobaxterm.mobatek.net). " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Linux Command Basics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are a bunch of Linux tutorials online. I particularly like [this one](https://ryanstutorials.net/linuxtutorial/). You should at least read Chapter 1 - Chapter 5. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Text Editors\n", "\n", "By default, there are 3 text editors available: *vim*, *emacs* and *nano*. Just pick up one of them. I personally use *vim* but it has the steepest learning curve. There are many discussions on which one to choose (for example, [this article](https://medium.com/linode-cube/emacs-nano-or-vim-choose-your-terminal-based-text-editor-wisely-8f3826c92a68))." ] } ], "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.6.2" }, "toc": { "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "toc_cell": false, "toc_position": {}, "toc_section_display": "block", "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }