Skip to content

Unix Command Line

Natalie Gill edited this page Mar 3, 2026 · 22 revisions

Description

Knowing how to use the command line of your computer can save you a lot of time. In these workshops, you will learn how to navigate the Unix terminal, process files, set permissions, etc. The only thing you need is a Mac or Linux laptop (you can use Windows if you can’t access a Linux machine).

Part I (Introductory):

  • What is the command line?
  • Navigating the file system
  • Installing software
  • Files & permissions
  • Downloading files from the internet
  • Manipulating and searching text files

Part II (Intermediate):

  • File Compression/decompression
  • System variables
  • Shell scripting
  • Other helpful commands
  • AWK - advanced text manipulation

Learning Path

The two workshops in this series are divided into novice and intermediate/advanced.

Novice

  • Part I (Introductory)

This is an introductory workshop in the Computer Skills series. No prior experience required. No prerequisites.

Intermediate

  • Part II (Intermediate)

The second part will cover more advanced commands and shell scripting. This workshop is intended for those who have completed the Introductory workshop.

Materials

Pre-workshop Instructions

Mac/Linux

  • No need to install anything, these operating systems are UNIX based.
  • To open your terminal on your Mac, just press Cmd + Space and type "terminal". On Linux just press Ctrl+Alt+T.
  • This workshop will be taught using the bash shell.
  • Check which shell your terminal is set to by typing echo $0 and pressing enter/return.
  • If it is not set to bash, you can change it by typing chsh -s /bin/bash and pressing enter/return. You will need to restart your terminal for the changes to take effect.

Windows 11

Since Windows is not a UNIX based operating system, Windows Subsystem for Linux (WSL) is required to access the UNIX command line (please note that admin permissions are required to install WSL). This allows you to run a virtual machine on your PC that runs the Ubuntu OS (UNIX based).

  • Open PowerShell or Command Prompt as Administrator (right-click → "Run as administrator").
  • Run the following command: wsl --install
  • Restart your computer if prompted.
  • After restarting, open the Ubuntu app from the Start menu.
  • You will be prompted to create a username and password for your Ubuntu account (can be different from your Windows user account).
  • Open the properties of the Ubuntu terminal by right clicking on the title bar and selecting "Properties".
  • In the "Options" tab, check the box next to "Use Ctrl+Shift+C/V as Copy/Paste" and click OK.
  • Note that copy and paste in the Ubuntu terminal is done using Ctrl+Shift+C and Ctrl+Shift+V, respectively.
  • Your Windows files are accessible from Ubuntu at /mnt/c/. For example, your Desktop is at /mnt/c/Users/YourUsername/Desktop. You can navigate there with: cd /mnt/c/Users/YourUsername/

You are now ready to use the UNIX command line on your Windows machine.

Online Learning

You can access these materials remotely at any time and go through them at your own pace. Just follow the commands in the slides. Type each command in your terminal and press enter/return.

If you have any questions, please contact Natalie Gill (natalie.gill@gladstone.ucsf.edu) or the Bioinformatics Core (bioinformatics@gladstone.ucsf.edu).

Additional recommended materials for online learning

  1. Software carpentry provides a self paced course: The Unix Shell

  2. Free online books:

Clone this wiki locally