Session 4: Linux Command Line

Date: 10/02/2017, Monday

This week we are going to use Harvard’s Odyssey supercomputer. It is a Linux system, just like most remote servers. Before playing with Odyssey I strongly recommend you to get familiar with Linux basics.

Why command line, not graphical interface?

  1. Command line is more like programming so it allows you to do much more, such as renaming 1000 files.
  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.

Linux commmand line is an absolutely essential skill for any programmers (much more important than MATLAB 🙂), so learn it!

Trying Linux command on your Laptop

On Mac

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.

For connecting to remote servers, simply execute ssh username@ip_address in the terminal.

On Windows

Window’s own command line is very different from Linux’s. On Windows 10, you can follow this official tutorial 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.

For connecting to remote servers, you can use the old putty or try more advanced ones like MobaXterm.

Linux Command Basics

There are a bunch of Linux tutorials online. I particularly like this one. You should at least read Chapter 1 - Chapter 5.

Text Editors

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).