Skip to content

Shell Basics

Eugenia Chen edited this page Nov 11, 2020 · 3 revisions

Contents

What is a shell?

A shell is a textual user interface used to access to services of an operating system (OS). There are different types of shells, for example: Bash and Zsh. You can access the shell on your computer through Terminal (for Macs) / Command Prompt (for Windows).

Common Shell Commands

  • cd: Change directory
  • ls: List files
  • pwd: Print working directory
  • cat <filename>: prints out contents of one or more files
  • mkdir <directory name>: make a new directory

Command Options

Options are flags that change the behavior of commands. They often start with “-” or “--”. For example, ls -l will list files and some properties of the files.

Shell Shortcuts

Use these keyboard shortcuts in your shell to do useful things!

  • Ctrl-C: stops the current process
  • Up arrow: copy a previous command
  • Ctrl-R: search for a previous command